#include <stdlib.h>
#include <stdio.h>
#include <queue>
using namespace std;

int main ()
{
    long K;
    long long tx = - 1000000000 + 1, ty = 1000000000 - 1;

    queue< pair<long long, long long > > output;
    int n = 0;
    int cnt = 0;
    int ind  = 1;
    int d = 0;

    while (cnt<K)
    {
        int i = 3;
        while ( (i+1)*(i)*(i-1)/6 <= K-cnt )
            i++;

        output.push ({tx, ty});
        for (int j=1; j<i; i++)
        {
            ty--;
            output.push ({tx, ty});
        }
        n += i;
        d += i;
        tx += 2;
        if (ind==0)
        {
            ty -= d + 1;
            d = 0;
            ind = 1;
        }
        else
            ind = 0;
    }

    printf ("%d\n", n);
    while (output.size ())
    {
        printf ("%lld %lld\n", output.front ().first, output.front ().second);
    }


    return 0;
}