#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define ll long long
#define MAXABS 1000000000LL

using namespace std;

ll bs(ll k) {

    ll left = 1, right = 1000, n = 1;
    while(left <= right) {
        int mid = (left + right) / 2;

        if(mid * (mid - 1) * (mid - 2) / 6 <= k) {
            n = mid;
            left = mid + 1;
        } else {
            right = mid - 1;
        }
    }

    return n;
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    ll k;
    cin >> k;
    
    ll n = 0, dy = 0, x = -1, y = 0;
    vector< pair<ll, ll> > sol;
    while(k > 0) {
        int m = bs(k);
        n += m - (dy ? 1 : 0);
        k -= m * (m - 1) * (m - 2) / 6;

        for(int i = (dy ? 1 : 0); i < m; i++) {
            y += dy;
            x++;
            sol.pb(mp(x, y));
        }

        dy++;
    }

    cout << n << endl;
    for(auto k: sol)
        cout << k.first - MAXABS << " " << k.second - MAXABS << endl;
    return 0;
}