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