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

int fact (int n) {
    return (n*(n-1)*(n-2)/6);
}
int skver (int n) {
    int res=0;
    res+=2*n*fact(n);
    for (int i=n-1;i>=3;i--) {
        res+=4*fact(i);
    }
    res+=2*fact(n);
    return res;
}
vector<vector<int> > tacke;
int res=0;
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++) {
        tacke[0].push_back(t);
        tacke[1].push_back(y);
        res+=1;
    }
    pisi (k-fact(i),t,y+1);
}
int main() {
    int n;
    scanf("%d",&n);
    tacke.resize(2);
    if (n>pow(10,6)) {
        int t=37;
        while (skver(t)<=n) t++;
        t--;
        for (int i=-pow(10,9); i<-pow(10,9)+t; i++) {
            for (int k=-pow(10,9); k<-pow(10,9)+t; k++) {
                tacke[0].push_back(i);
                tacke[1].push_back(k);
            }
        }
        pisi(n-skver(t),-pow(10,9)+2*t+1,-pow(10,9)+t);
        cout<<res+t*t<<endl;
        for (int i=0;i<res+t*t; i++) {
            cout<<tacke[0][i]<<" "<<tacke[1][i]<<endl;
        }
        return 0;
    }
    pisi(n,-pow(10,9),-pow(10,9));
    cout<<res<<endl;
    for (int i=0; i<res; i++) {
        cout<<tacke[0][i]<<" "<<tacke[1][i]<<endl;
    }
    return 0;
}