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