#include <bits/stdc++.h>
#define ll long long

using namespace std;
int k;
int bin[2000];
vector<pair<int,int> >tacke;
int x0,y0, tx, ty, tx2, ty2, tx3, ty3;
map<pair<int,int>, int> koef;

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

	cin>>k;
	for(int i=3;i<=1000;i++)
        bin[i]=(i*(i-1)*(i-2))/6;//, cout<<bin[i]<<endl;
	int index=999;
	x0=0;
	y0=0;
	while(k>0 && index>=3)
    {
        if(bin[index]<=k)
        {
            //cout<<index<<" "<<bin[index]<<endl;
            k-=bin[index];
            for(int i=0;i<index;i++)
                tacke.push_back(make_pair(x0,y0)), x0++;

            y0++;
            x0--;
            x0*=2;
            x0++;
        }
        else
        index--;
    }

    cout<<tacke.size()<<endl;
    for(int i=0;i<tacke.size();i++)
        cout<<tacke[i].first<<" "<<tacke[i].second<<endl;
    //return 0;
    //cout<<"*"<<k<<endl;
    /*for(int i=0;i<tacke.size();i++)
    {
        tx=tacke[i].first;
        ty=tacke[i].second;
        //cout<<tacke[i].first<<" "<<tacke[i].second<<endl;
        for(int j=i+1;j<tacke.size();j++)
        {
            tx2=tacke[j].first;
            ty2=tacke[j].second;
            int dx=abs(tx2-tx);
            int dy=abs(ty2-ty);
            if(dy==0)
                continue;
            int nzd=__gcd(dx,dy);
            dx/=nzd;
            dy/=nzd;
            for(int r=j+1;r<tacke.size();r++)
            {
                tx3=tacke[r].first;
                ty3=tacke[r].second;
                int dx2=abs(tx2-tx3);
                int dy2=abs(ty2-ty3);
                int nzd2=__gcd(dx2,dy2);
                dx2/=nzd;
                dy2/=nzd;
                if(dx2==dx && dy2==dy)
                {
                    cout<<".i."<<" "<<dx<<" "<<dy<<"  "<<tx3<<" "<<ty3<<endl;
                    //return 0;
                }
            }
        }
    }*/

	return 0;
}