#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll uk;
int k;
vector<pair<ll,pair<int,int>>> ve;

void stampajred(int y,int x)
{
    for(int i=1;i<=x;i++)
    {
        cout << i << " " << y << "\n";
    }
}

void stampajredneg(int y,int x)
{
    for(int i=1;i<=x;i++)
    {
        cout << -i << " " << y << "\n";
    }
}

void stampajkol(int x,int y)
{
    for(int i=1;i<=y;i++)
    {
        cout << x << " " << i << "\n";
    }
}

void stampajkolneg(int x,int y)
{
    for(int i=1;i<=y;i++)
    {
        cout << x << " " << -i << "\n";
    }
}

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cerr.tie(0);
    
    cin >> k;
    
    if(k<=10)
    {
        if(k==1) 
        { 
            cout << 3 << "\n";
            stampajred(1,3);
        }
        else if(k==2)
        {
            cout << 6 << "\n";
            stampajred(1,3);
            stampajred(2,3);
        }
        else if(k==3)
        {
            cout << 7 << "\n";
            stampajred(1,3);
            stampajred(2,3);
            stampajred(4,1);
        }
        else if(k==4)
        {
            cout << 4 << "\n";
            stampajred(1,4);
        }
        else if(k==5)
        {
            cout << 6 << "\n";
            stampajred(1,4);
            cout << 1 << " " << 2 << "\n";
            cout << 1 << " " << 3;
        }
        else if(k==6)
        {
            cout << 8 << "\n";
            stampajred(1,4);
            stampajred(2,3);
            stampajred(5,1);
        }
        else if(k==7)
        {
            cout << 8 << "\n";
            stampajred(1,4);
            stampajred(2,3);
            stampajred(3,1);
        }
        else if(k==8)
        {
            cout << 9 << "\n";
            stampajred(1,3);
            stampajred(2,3);
            stampajred(3,3);
        }
        else if(k==9)
        {
            cout << 9 << "\n";
            stampajred(1,4);
            stampajred(2,3);
            stampajred(3,2);
        }
        else
        {
            cout << 5 << "\n";
            stampajred(1,5);   
        }
    }
    else
    {
        ll temp = k;
        int svetacke = 1;
        
        for(int i = 900;i>=1;i--)
        {
            for(int j = i;j>=1;j--)
            {
                uk = (ll)i*(i-1)*(i-2)/6 + (ll)j*(j-1)*(j-2)/6 + min(i,j);
                if(uk<=temp)
                {
                    ve.push_back({temp-uk,{i,j}});
                }
            }
        }
        
        sort(ve.begin(),ve.end());
        
        auto xx = ve[0];
        ll ostalo = xx.first;
        int gore = xx.second.first;
        int dole = xx.second.second;
        svetacke+=gore+dole;
        if(ostalo==0)
        {
            cout << svetacke << "\n";
            cout << 0 << " " << 0 << "\n";
            stampajred(2000,gore);
            stampajredneg(-2000,dole);
            exit(0);
        }
        
        temp=ostalo;
        //cout << temp << " " << "\n";
        ve.clear();
        for(int i = 900;i>=0;i--)
        {
            for(int j = i;j>=0;j--)
            {
                uk = (ll)i*(i-1)*(i-2)/6 + (ll)j*(j-1)*(j-2)/6 + min(i,j);
                if(uk<=temp)
                {
                    ve.push_back({temp-uk,{i,j}});
                }
            }
        }
        
        sort(ve.begin(),ve.end());
        
        xx = ve[0];
        ostalo = xx.first;
        int gore2 = xx.second.first;
        int dole2 = xx.second.second;
        svetacke+=gore2+dole2;
        cout << svetacke << "\n";
        cout << 0 << " " << 0 << "\n";
        stampajred(2000,gore);
        stampajredneg(-2000,dole);
        stampajkol(2000,gore2);
        stampajkolneg(-2000,dole2);
        
       // cout << ostalo << "\n";
        
    }
   
    
    return 0;
}