//Kada nikog nema samo budi tu
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ldb long double
#define mt make_tuple
#define pii pair<int,int>
int k;
vector<pii> ans;
void input(){
	scanf("%i",&k);
}
void output(){
	printf("%i\n",ans.size());
	for(auto p:ans)printf("%i %i\n",p.first,p.second);
}
void Solve(){
	ans.clear();
	ans.pb({0,0});
	ll ost=k;
	int cnt=0;
	for(int i=2000;i>=3;i--){
		ll tmp=(ll)i*(i-1)*(i-2)/6;
		while(ost>=tmp){
			for(int j=1;j<i;j++)ans.pb({ans.back().first+1,ans.back().second+cnt});
			cnt++;
			ost-=tmp;
		}
	}
}
void Run(){
	input();
	Solve();
	output();
}
mt19937 rng(time(0));
void MakeTestCase(){
	k=rng()%100000000+1;
}
pii operator-(pii a,pii b){return mp(a.first-b.first,a.second-b.second);}
ll cross(pii a,pii b){return (ll)a.first*b.second-(ll)a.second*b.first;}
ll cross(pii a,pii b,pii c){return cross(a-b,c-b);}
bool Check(){
	if(ans.size()>2000)return 0;
	for(auto p:ans)if(max(abs(p.first),abs(p.second))>1000000000)return 0;
	ll cnt=0;
	for(int i=0;i<ans.size();i++)
		for(int j=i+1;j<ans.size();j++)
			for(int k=j+1;k<ans.size();k++)
				if(cross(ans[i],ans[j],ans[k])==0)
					cnt++;
	return cnt==k;
}
void Print(){
	printf("k: %i\n",k);
	printf("n: ");
	output();
}
double GetTime(){return (ldb)clock()/CLOCKS_PER_SEC;}
double s_time,e_time,d_time;
void Start(){s_time=GetTime();}
void Stop(){e_time=GetTime();d_time=e_time-s_time;}
void Test(){
	cout<<fixed<<setprecision(4);
	int work=100000;
	double max_time=0;
	bool speed_only=0;
	int mxn=0;
	//for(int i=1;i<=work;i++){
	for(int i=100000000;i>=1;i--){
		//MakeTestCase();
		k=i;
		Start();
		Solve();
		Stop();
		if(!Check()){
			Print();
			return;
		}
		max_time=max(max_time,d_time);
		mxn=max(mxn,(int)ans.size());
		cout<<i<<":OK, max time so far="<<max_time<<", max n so far="<<mxn<<"\n";
		//if(i%10000==0)printf("now: %i mxn:%i\n",i,mxn);
	}
	cout<<mxn<<"\n";
	cout<<":D\n";
}
int main(){
	Run();
	return 0;
}