n=int(input()) if n==1: print(-1) exit() Ans=[] for q in range(2**n): Ans.append(list(range(q*2**n, (q+1)*2**n))) for q in range(0,2**n,2): Ans[q][q],Ans[q][q+1]=Ans[q][q+1],Ans[q][q] Ans[q+1][q],Ans[q][q]=Ans[q][q],Ans[q+1][q] Ans[q][q+2-n],Ans[q+1][q+2-n]=Ans[q+1][q+2-n],Ans[q][q+2-n] for q in range(2**n): print(*Ans[q])