#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    if(n==2){
        cout<<"1 3"<<endl;
        cout<<"4 2"<<endl;
    }
    else if(n==3){
        cout<<"1 5 3"<<endl;
        cout<<"2 6 4"<<endl;
    }
    else if(n==4){
        cout<<"1 7 3 5"<<endl;
        cout<<"8 2 6 4"<<endl;
    }
    else{
        cout<<"1 9 3 7 5"<<endl;
        cout<<"10 2 8 4 6"<<endl;
    }
}