#include <iostream>
using namespace std;

pair<long long, long long> a[4001];

int main()
{
    long long k;
    cin >> k;
    long long k1 = k;
    long long x = 0, y = 0, d = 1, br1 = 11, br2 = 0;
    while (k > 0) {
        long long suma = 1;
        long long l = 4;
        while (l * suma / (l - 3) <= k) {
            suma = suma * l;
            suma /= (l - 3);
            l++;
        }
        long long br = l - 2;
        d += br;
        if (k == k1) {
            for (long long i = 1; i <= br; i++) {
                x++;
                a[br2].first = x;
                a[br2++].second = 0;
            }
        }
        else {
            for (long long i = 1; i <= br; i++) {
                x += br1;
                y++;
                a[br2].first = x;
                a[br2++].second = y;
            }
            br1--;
        }
        k -= suma;
    }
    cout << d << endl;
    cout << 0 << " " << 0 << endl;
    for (long long i = 0; i < br2; i++)
        cout << a[i].first << " " << a[i].second << endl;
    return 0;
}