#include <bits/stdc++.h>
using namespace std;
long long bk[2020];
vector <long long> brtacaka;
int main()
{
    long long k, i, j;
    cin >> k;
    bk[3] = 1;
    for(i = 4; i < 2005; i++) bk[i] = (bk[i - 1]*i)/(i - 3);
    i = 2000;
    while(k)
    {
        if(bk[i] > k) i--;
        else
        {
            k = k - bk[i];
            brtacaka.push_back(i);
        }
    }
    for(i = 0; i < brtacaka.size(); i++)
    {
        for(j = 1; j <= brtacaka[i]; j++) cout << j << " " << (i + 1)*j << endl;
    }
    return 0;
}