import itertools def f(n, flg): for P in itertools.permutations(range(1, 3 * n + 1)): if P[0] != 1: break t1 = 0 t2 = 0 for i in range(n): t1 += P[i] * P[i + n] t2 += P[i + n] * P[i + 2 * n] if t1 == t2: if not flg: return P add = 3 * n Q = [p + add for p in P] t1 = 0 t2 = 0 for i in range(n): t1 += Q[i] * Q[i + n] t2 += Q[i + n] * Q[i + 2 * n] if t1 == t2: return P n = int(input()) if n == 1: print(-1) exit() m = n % 3 if m < 2: m += 3 A = list(f(m, False)) B = list(f(3, True)) L = [] M = [] R = [] for i in range(m): L.append(A[i]) M.append(A[i + m]) R.append(A[i + 2 * m]) for i in range((n - m) // 3): add = 3 * m + 9 * i for t in range(3): L.append(B[t] + add) M.append(B[t + 3] + add) R.append(B[t + 6] + add) A = L + M + R print(*A) assert len(A) == 3 * n t1 = 0 t2 = 0 for i in range(n): t1 += A[i] * A[i + n] t2 += A[i + n] * A[i + 2 * n] assert t1 == t2