#include <bits/stdc++.h>
using namespace std;

int n3(int n)
{
    return n*(n-1)*(n-2)/6;
}

vector<pair<int,int> > tacke;
void crtaj(int hor, int ver, int x)
{
    while(x--)
    {
        tacke.push_back(make_pair(hor,ver));
        hor+=10000;
    }
}

int main()
{
    int k;
    cin>>k;
    int hor=0,ver=0,i=1;
    while(k>0)
    {
        int x=3;
        for(x;;x++)
            if(x*(x-1)*(x-2)/6>k)
                break;
        x--;
        k-=x*(x-1)*(x-2)/6;
        crtaj(hor,ver,x);
        ver++;
        hor+=i;
        i++;
    }

    cout<<tacke.size()<<"\n";
    for(int i=0; i<tacke.size(); i++)
        cout<<tacke[i].first<<" "<<tacke[i].second<<"\n";

    /*
    int maks=-1;
    int makstac=-1;
    for(int i=1; i<=1e8; i++)
    {
        int br=0;
        int k=i;
        int brtac=0;
        while(k>0)
        {
            int x=3;
            for(x;;x++)
                if(x*(x-1)*(x-2)/6>k)
                    break;
            x--;
            k-=x*(x-1)*(x-2)/6;
            brtac+=x;
            br++;
        }
        maks=max(maks,br);
        makstac=max(makstac,brtac);
    }
    cout<<maks<<" "<<makstac;
    */
    return 0;
}