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

int fact (int n) {
    return (n*(n-1)*(n-2)/6);
}
void pisi (int k, int x, int y) {
    if (k==0) return;
    int i=(int)(pow(6*(double)k,0.333333))+2;
    while (fact(i)>(int)k) {
        i--;
        }
    int t;
    for (t=x; t<x+i; t++) {
        cout<<t<<" "<<y<<endl;
    }
    pisi (k-fact(i),t,y+1);
}
int main() {
    int n;
    scanf("%d",&n);
    pisi(n,-pow(10,9),-pow(10,9));
}