#include #include #include using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 1000000000000000001 int main(){ int N; cin>>N; if(N%2==1){ cout<<-1<> a = {{7 ,14, 0, 8},{4 ,12 ,2 ,11},{15, 9, 6 ,1},{13, 10 ,5 ,3}}; int n = 1<<(N); vector ans(n,vector(n)); rep(i,n/4){ rep(j,n/4){ rep(k,4){ rep(l,4){ ans[i*4+k][j*4+l] = a[k][l] + (i*(n/4)+j) * 16; } } } } rep(i,n){ rep(j,n){ if(j!=0)cout<<' '; cout<