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

namespace SAZVEŽÐA
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            int[] m = new int[1000];
            double[] x = new double[1000];
            double s = 0;
            int p = 3;
            double a, b;
            int n = 1;
            while (s <= t) 
            {
                for (int i = 0; i <= p - 3; i++) 
                {
                    a = 1;
                    b = 1;
                    for (int j = 2; j <= p; j++)
                    {
                        if (j - i > 4) b = b * (j - i - 3);
                        if (j - i > 0) a = a * (j - i);
                    }
                    if (i == 0) s = a / 6 / b * (2 * p + 2);
                    else s += a / 6 / b * 4; 
                }
                m[n] = p * p;
                x[n] = s;
                p++;
                n++;
            }
            int k;
            if (x[n - 2] != 0) k = t / (int)x[n - 2];
            else k = 0;
            int l;
            if (x[n - 2] != 0) l = t % (int)x[n - 2];
            else l = t;
            Console.WriteLine(m[n - 2] * k + 3 * l);
            for (int i1 = 0; i1 < k*Math.Sqrt(m[n - 2]); i1+= (int)Math.Sqrt(m[n - 2]))
            {
                for (int i = -1000000000+i1; i < -1000000000+i1 + Math.Sqrt(m[n - 2]); i++)
                {
                    for (int j = -1000000000+i1; j < -1000000000+i1 + Math.Sqrt(m[n - 2]); j++)
                    {
                        Console.WriteLine(i + " " + j);
                    }
                }
            }
            int z = 0;
            for (int i = 0; i < l; i++) 
            {
                if(i%2==0)
                for (int j = 0 ; j < 3 ; j++)
                {
                    Console.WriteLine(i + " " + j);
                }
                else
                for (int j = 0 + z; j < 3 + z; j++) 
                {
                    Console.WriteLine(i + " " + j);
                }
                z += 3;
            }
        }
    }
}