#include <bits/stdc++.h>

using namespace std;

int main()
{
    std::ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int ;
    cin >> n;
    if(n == 2){
        cout << "1 3" << endl << "4 2";
    }
    else if(n == 3){
        cout << "1 6 2" << endl << "3 5 4";
    }
    else if(n == 4){
        cout << "1 8 2 6" << endl << "3 7 4 5";
    }
    else if(n == 5){
        cout << "1 10 2 9 5" << endl << "3 8 4 7 6";
    }
}