#include<bits/stdc++.h>

using namespace std;
long long k;
int main(){
    cin>>k;
    if(k==1){
        cout<< 3 <<endl;
        cout<< 0 << 0 <<endl;
        cout<< 1 << 0 <<endl;
        cout<< 2 << 0 <<endl;
    }
    else if(k==2){
        cout<< 5 <<endl;
        cout<< 0 << 2 <<endl;
        cout<< 0 << 1 <<endl;
        cout<< 0 << 0 <<endl;
        cout<< 1 << 0 <<endl;
        cout<< 2 << 0 <<endl;
    }
    else if(k==3){
        cout<< 6 <<endl;
        cout<< 0 << 0 <<endl;
        cout<< 1 << 1 <<endl;
        cout<< 2 << 2 <<endl;
        cout<< 3 << 1 <<endl;
        cout<< 4 << 0 <<endl;
        cout<< 2 << 0 <<endl;
    }
    else if(k==4){
        cout<< 4 <<endl;
        cout<< 0 << 0 <<endl;
        cout<< 1 << 1 <<endl;
        cout<< 2 << 2 <<endl;
        cout<< 3 << 3 <<endl;
    }
    else if(k==5){
        cout<< 7 <<endl;
        cout<< 0 << 0 <<endl;
        cout<< 1 << 0 <<endl;
        cout<< 2 << 0 <<endl;
        cout<< 0 << 2 <<endl;
        cout<< 1 << 2 <<endl;
        cout<< 2 << 2 <<endl;
        cout<< 1 << 1 <<endl;
    }
    else if(k==6){
        cout<< 8 <<endl;
        cout<< 0 << 0 <<endl;
        cout<< 1 << 0 <<endl;
        cout<< 2 << 0 <<endl;
        cout<< 0 << 2 <<endl;
        cout<< 1 << 2 <<endl;
        cout<< 2 << 2 <<endl;
        cout<< 1 << 1 <<endl;
        cout<< 0 << 1 <<endl;
    }
    else if(k==7){
        cout<< 9 <<endl;
        cout<< 0 << 0 <<endl;
        cout<< 1 << 0 <<endl;
        cout<< 2 << 0 <<endl;
        cout<< 0 << 2 <<endl;
        cout<< 1 << 2 <<endl;
        cout<< 2 << 2 <<endl;
        cout<< 1 << 1 <<endl;
        cout<< 0 << 1 <<endl;
        cout<< 3 << 1 <<endl;
    }
    else if(k==8){
        cout<< 9 <<endl;
        cout<< 0 << 0 <<endl;
        cout<< 1 << 0 <<endl;
        cout<< 2 << 0 <<endl;
        cout<< 0 << 2 <<endl;
        cout<< 1 << 2 <<endl;
        cout<< 2 << 2 <<endl;
        cout<< 1 << 1 <<endl;
        cout<< 0 << 1 <<endl;
        cout<< 2 << 1 <<endl;
    }
    else if(k==9){
        
    }
        
    
    



    
    
    
    return 0;
}