#include using namespace std; #define all(v) (v).begin(),(v).end() #define pb(a) push_back(a) #define rep(i, n) for(int i=0;i> n; if(n % 4 == 1) { cout << -1 << endl; return 0; } vector ans(n * 3, -1); rep(i, n) ans[i + n] = (i + 1) * 3; int m = n; while(m) { if(m >= 4) { int num = m * 3; ans[m - 1] = num - 1; ans[m - 1 + n * 2] = num - 2; num -= 3; m --; ans[m - 1] = num - 2; ans[m - 1 + n * 2] = num - 1; num -= 3; m --; ans[m - 1] = num - 2; ans[m - 1 + n * 2] = num - 1; num -= 3; m --; ans[m - 1] = num - 1; ans[m - 1 + n * 2] = num - 2; num -= 3; m --; continue; } if(m == 3) { ans[0] = 1; ans[1] = 2; ans[2] = 8; ans[n * 2] = 7; ans[n * 2 + 1] = 5; ans[n * 2 + 2] = 4; m -= 3; } else { ans[0] = 1; ans[1] = 4; ans[n * 2] = 5; ans[n * 2 + 1] = 2; m -= 2; } } foa(e, ans) cout << e << " "; cout << endl; return 0; }