#include <iostream>
#include <vector>
#include <math.h>
using namespace std;

int main()
{
    int n; cin >> n;
    vector<int> a(n);
    vector<int> b(n);
    if(n == 2)
    {
        cout << "1 3" << endl;
        cout << "4 2";
    }
    else if(n == 3)
    {
        cout << "4 1 5" << endl;
        cout << "3 6 2";
    }
    else if (n == 4)
    {
        cout << "5 1 7 3" << endl;
        cout << "4 8 2 6";
    }
    else if(n == 5)
    {
        cout << "6 1 9 3 7" << endl;
        cout << "5 10 2 8 4";
    }
}