using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Treci_Zadatak
{
    class Program
    {
        static int Nadji(int k)
        {
            int n = 100, t = 100;
            while (true)
            {
                if (n * (n + 1) * (n + 2)/6 > k)
                {
                    if (t == 1) return n - 1;
                    n -= t;
                    t = t / 10;
                }
                else n += t;
            }
        }
        static void Main()
        {
            int k = Convert.ToInt32(Console.ReadLine()), broj = 0,x = 0, y = 0; ;
            int[] nizX = new int[2000];
            int[] nizY = new int[2000];
            while (k != 0)
            {
                int t = Nadji(k);
                for (int i = 0; i < t+2; i++)
                {
                    nizX[broj+i] = x;
                    nizY[broj+i] = y;
                    x++;
                }
                broj += t + 2;
                x += 10 + x;
                y += 5;
                k -= t * (t + 1) * (t + 2) / 6;
            }
            Console.WriteLine(broj);
            for (int i = 0; i < broj; i++) Console.WriteLine(nizY[i] + " " + nizX[i]);
        }
    }
}