n = int(input()) if n == 1: print(-1) exit() base = [[7,14,0,8], [4,12,2,11], [15,9,6,1], [13,10,5,3]] if n == 2: ans = base else: ans = [[0]*(1<