#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <ll,ll> p;
const ll K = 1e8+56;

ll k;
ll pk = 0;
vector <ll> v;
vector <p> res;
ll poc[1005];

bool col(ll x1,ll y1,ll x2,ll y2,ll x3,ll y3){
    ll a = x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2);
    return (!a);
}

void proveri(){
    ll br = 0;
    for(int i = 0; i < res.size(); i++){
        for(int j = i+1; j < res.size(); j++){
            for(int h = j+1; h < res.size(); h++){
                br += col(res[i].first,res[i].second,res[j].first,res[j].second,res[h].first,res[h].second);
            }
        }
    }
    if(br != pk){
        cout << "jebiga, ima " << br << endl;
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> k;
    pk = k;
    ll tacaka = 0;
    for(ll i = 845; i >= 3; i--){
        ll trojki = (i*(i-1)*(i-2))/6;
        ll puta = k/trojki;
        tacaka += puta*i;
        k -= puta*trojki;
        for(int j = 0; j < puta; j++){
            v.push_back(i);
        }
    }
    ll y = 0;
    for(ll i = 0; i < v[0]; i++){
        res.push_back(p(i*1000ll,y));
        poc[i] = i*1000ll;
    }
    y = 1;
    for(int i = 1; i < v.size(); i++){
        ll cnt = v[i];
        for(int j = 0; j < cnt; j++){
            if(i%2 == 1){ /// desno
                res.push_back(p(poc[j]+(i+1)/2,y));
            }
            else{ /// levo
                res.push_back(p(poc[j]-(i+1)/2,y));
            }
        }
        y += i+1;
    }
    cout << res.size() << "\n";
    for(auto f : res){
        cout << f.first << " " << f.second << "\n";
    }
    //proveri();
}