#include <bits/stdc++.h>
using namespace std;

vector<pair<int, int>> vk;

void rek(int xs, int ys, int k){
    vk.push_back({xs, ys});
    vk.push_back({xs + 1, ys});
    xs += 2;

    int i = 3;
    int rs = -1;
    while(1){
        vk.push_back({xs, ys});
        xs++;
        int n = i * (i - 1) * (i - 2) / 6;
        int ne = (i + 1) * i * (i - 1) / 6;
        if(ne > k){
            rs = n;
            break;
        }
        ++i;
    }

    if(k == rs)
        return;
    rek(xs, ys + 1, k - rs);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int k;
    cin >> k;
    rek(-1e9, -1e9, k);

    cout << vk.size() << "\n";
    for(auto x : vk)
        cout << x.first << " " << x.second << "\n";
    return 0;
}