#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<<"4 1 6"<<endl;
        cout<<"5 2 3"<<endl;
    }
    else if(n==4){
        cout<<"6 1 8 3"<<endl;
        cout<<" 7 2 5 4"<<endl;
    }
    else{
        cout<<"8 1 10 3 6"<<endl;
        cout<<"9 2 7 4 5"<<endl;
    }
}