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

using namespace std;

ll form(ll n){
    return n * (n-1) * (n-2) / 6;
}

vector<pair<int, int> > resenje;

int bin(int c){
    int l = 1, h = 2000;
    while (l < h){
        int mid = l + (h-l)/2;
        ll br = form(mid);
        if (br <= c){
            l = mid + 1;
        }
        else h = mid;
    }
    return h-1;
}

void solve(int k, int trx, int trny){
    if (k == 0)
        return;
    int br = bin(k);
    ll ex = form(br);
    for (int i = trny; i < trny+ br; ++i){
        resenje.push_back({trx, i});
    }
    if (trx % 2){
        int temp = trny + br - 1;
        trny += temp + 1000000000;
    }
    solve(k - ex, trx + 1, trny + br);
}

int main()
{
    int k;
    cin >> k;
    solve(k, 0, -1000000000);
    cout << resenje.size() << endl;
    for (int i = 0; i < resenje.size(); ++i){
        cout << resenje[i].first << " " << resenje[i].second << endl;
    }
    return 0;
}