#include<iostream>
#include<algorithm>
#include<vector>
#include<utility>
using namespace std;
const int inf = 2e9;
int v[1000], i, j, n, ind, k, r, p, x, y;
bool m;
vector<pair<int,int>> res;
int lb(int b) {
	return lower_bound(v, v + 900, b, [](int a, int b) {return a > b; }) - v;
}

int main() {
	for (i = 3; i < 900; ++i) {
		v[i] = i * (i - 1) * (i - 2) / 6;
	}
	for (i = 0; i < 450; ++i)swap(v[i], v[899 - i]);
	cin >> k;
	while (k) {
		ind = lb(k);
		p = v[ind];
		j = 899 - ind;
		k -= p;

		if (x + p > inf)x = 0, m=1,y=0;
		for (i = 0; i < j; ++i) {
			res.push_back({ x - 1e9 + i, y - 1e9 + 1e9 * m });
		}
		x = (x + j) * 2;
		++y;
	}
	cout << res.size() << '\n';
	for (auto e : res)cout << e.first << ' ' << e.second << '\n';
}