#include <bits/stdc++.h>

using namespace std;

int main()
{
    iostream::sync_with_stdio(false);

    int n;
    cin >> n;
    int m=2*n;
    /*vector<int> a(n),b(n);

    int mxa=m,mna=n,mxb,mnb=1;
    for(int i=0; i<n; i++)
    {
        if(i%2==0)
        {
            a[i]=mna;
            mna--;
        }
        else
        {
            a[i]=mxa;
            mxa--;
        }
    }
    mxb=mxa;
        for(int i=0; i<n; i++)
    {
        if(i%2==0)
        {
            b[i]=mxb;
            mxb--;
        }
        else
        {
            b[i]=mnb;
            mnb++;
        }
    }




    for(auto c:a)cout << c << " ";
    cout << "\n";
    for(auto c:b)cout << c << " ";
    cout << "\n";*/

    cout << 4 << " " << 8 << " " << 3 << " " << 7 << "\n";
    cout << 6 << " " << 1 << " " << 5 << " " << 2 << "\n";


    return 0;
}