#include <bits/stdc++.h>

using namespace std;

int n, x, y;
vector<pair<int, int> > ans;

void place(int toP, int idx){
	for(int i = 0; i < toP; ++i){
		ans.push_back({x, y});
		--y;
	}
	x -= idx*1e6;
	y -= idx*1e6;
}

int main(){
	ios_base::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);
	cin >> n;
	x = 1e9;
	y = 1e9;
	int tmpIdx = 1;
	while(n){
		int tmp = 3;
		while(tmp*(tmp-1)*(tmp-2) / 6 <= n){
			++tmp;
		}
		--tmp;
		place(tmp, tmpIdx);
		++tmpIdx;
		n -= tmp*(tmp-1)*(tmp-2) / 6;
	}
	cout << ans.size() << '\n';
	for(auto x : ans){
		cout << x.first << ' ' << x.second << ' ';
	}
}