#include <bits/stdc++.h>
#define STAMPA for (int i = 1; i < n-1; ++i) {if (i % 2 == 1) {
#define ZID_1 printf("%d ", n-1);
#define ZID_2 printf("%d ", n);
#define ZID_3 printf("%d ", n+1);
#define ZID_4 printf("%d ", n+2);
#define V_DOLE printf("%d ", v--);
#define V_GORE printf("%d ", v++);
#define M_DOLE printf("%d ", m--);
#define M_GORE printf("%d ", m++);
using namespace std;

int main() {
    int n, i;
    scanf("%d", &n);

    if (n % 2 == 1) {
        int m = 1, v = n*2;

        ZID_2
        STAMPA
                V_DOLE
        } else {M_GORE
        }}
        ZID_1
        printf("\n");
        ZID_3
        STAMPA
                M_GORE
        } else {V_DOLE
        }}
        ZID_4
    } else {
        int m = 1, v = n*2;

        ZID_1
        STAMPA
                V_DOLE
        } else {M_GORE
        }}
        ZID_3
        printf("\n");
        ZID_4
        STAMPA
                M_GORE
        } else {V_DOLE
        }}
        ZID_2
    }
    return 0;
}