#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);
        dod--;
        k-=dp[dod];
        brtacaka+=(dod+3);

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

        x=x+100+brtacaka*4;
        y=y-120-brtacaka*3;
    }

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