#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <math.h>
#define ll long long
#define endl "\n"
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

int main()
{
    ios;
    int k, bnd, x = 0;
    cin >> k;
    vector<int>v;
    vector<pair<int, int>>res;

    for (int i = 3; i <= 900; i++)
        v.push_back(i*(i - 1)*(i - 2)/6);

    while (k > 0)
    {
        bnd = upper_bound(v.begin(), v.end(), k) - v.begin();
        --bnd;

        k -= v[bnd];

        for (int i = 0; i < bnd + 3; i++)
            res.push_back({x, i});

        x += 2;
    }

    cout << res.size() << endl;

    for (int i = 0; i < res.size(); i++)
        cout << res[i].first << " " << res[i].second << endl;


    return 0;
}