#include <bits/stdc++.h>

/*
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define rep(i,l,r) for (int i=l;i<=r;i++)
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ll long long
#define ull unsigned long long
#define mod 1000000007
#define nul(x) memset((x),0,sizeof((x)))
#define random_jbt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

using namespace std;

int main(){
    ios;

    int k;
    cin>>k;
    vector<int>v;
    vector<pair<int,int>>ans;
    for (int i=900;i>=3;i--){
        int f = i*(i-1)*(i-2)/6;
        while(f<=k){
            k-=f;
            v.pb(i);
        }
    }

    int x=-1e9,y=-1e9;
    for (int i=0;i<v.size();i++){
        for (int j=0;j<v[i];j++){
            ans.pb({x,y});
            x++;
        }
        x+=1e5+i*i;
        y+=1e5+i*i;
    }

    cout<<ans.size()<<"\n";
    for (auto i:ans){
        cout<<i.fi<<" "<<i.se<<"\n";
    }
    return 0;
}