#include <stdio.h>

long long nad(long long i)
{
    return (i*(i-1)*(i-2)/6);
}

int main()
{
    long long k;
    scanf("%lld",&k);
    long long a[2000];
    long long y=-1000000000,x=-1000000000;
    long long br=0;
    for (long long i=1000;i>=4;i--)
    {
        a[i]=k/nad(i);
        k%=nad(i);
        br+=i*a[i];
    }
    br+=k*3;
    printf("%lld\n",br);
    long long brojac=0,di,p=-1000000000,d;
    for (long long i=1000;i>=4;i--)
    {
        while (a[i]>0)
        {
            brojac++;
            if (brojac<3)
            {
                for (long long j=0;j<i;j++)
                {
                    printf("%lld %lld\n",x,y+j);
                }
                brojac++;
                x++;
                if (brojac==2) d=y+i;
                if (brojac==2) di=i;
            }
            else
            {
                long long k=d-p;
                long long n=d-k*(x-1);
                y=k*x+n;
                for (long long j=0;j<i;j++)
                {
                    printf("%lld %lld\n",x,y+j);
                }
                p=d-di+1;
                di=i;
                d=y;
                x++;
            }
            a[i]--;
        }
    }
    for (long long i=0;i<k;i++)
    {
        if (brojac<3)
        {
            for (long long j=0;j<3;j++)
            {
                printf("%lld %lld\n",x,y+j);
                if (brojac==1) p=x;
                if (brojac==2) d=y+j;
                x++;
            }
        }
        else{
        long long k=d-p;
        long long n=d-k*(x-1);
        y=k*x+n;
        for (long long j=0;j<3;j++)
        {
            printf("%lld %lld\n",x,y+j);
        }
        p=d-di+1;
        di=i;
        d=y;
        x++;
        }
    }
    return 0;
}