#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

    int k;
    cin >> k;

    int x = -10e8, y = 10e8;

    int dp[1001] = {0};
    dp[0] = 1;

    for(int i = 1; i <= 1000 ; i++)
    {
        dp[i] = (((i+3)*(i+2)*(i+1))/6);
    }

    int brtacaka = 0, dod, npr = 0;
    pair <int, int> nzpr[2000];

    while(k)
    {
        dod = (upper_bound(dp, dp+1001, k) - dp);
        k-=dp[dod-1];
        brtacaka+=(dod+2);

        dod+=2;
        while(dod--)
        {
            nzpr[npr] = {x,y};
            npr++;
            x++;
        }

        x+=10+k*5+dod*7;
        y-=12+k*12+dod*42;
    }

    cout << brtacaka << "\n";
    for(int i = 0; i < npr; i++)
    {
        cout << nzpr[i].first << " " << nzpr[i].second << "\n";
    }
}