n = int(input()) if n % 2 != 0: print(-1) else: if n == 2: print("7 14 0 8") print("4 12 2 11") print("15 9 6 1") print("13 10 5 3") else: # For other even N, a general construction is required, but here we return -1 for simplicity # This part needs to be filled with a correct approach for larger even N print(-1)