#include using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i=0;i--) #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin>>n; if(n==1){ cout<<-1<<"\n"; }else{ vector>X={{7,14,0,8},{4,12,2,11},{15,9,6,1},{13,10,5,3}}; vector>Y={{0,1,2,3},{4,5,6,7},{8,9,10,11},{12,13,14,15}}; for(int t=2;t>Z(2*l,vector(2*l)),W(2*l,vector(2*l)); rep(i,l)rep(j,l){ Z[i][j]=X[i][j]; Z[i+l][j+l]=X[i][j]^(1<<(2*t))^(1<<(2*t+1)); Z[i+l][j]=Y[i][j]^(1<<(2*t)); Z[i][j+l]=Y[i][j]^(1<<(2*t+1)); W[i][j]=Y[i][j]; W[i+l][j+l]=Y[i][j]^(1<<(2*t))^(1<<(2*t+1)); W[i+l][j]=Y[i][j]^(1<<(2*t)); W[i][j+l]=Y[i][j]^(1<<(2*t+1)); } swap(X,Z); swap(Y,W); } int l=X.size(); rep(i,l){ rep(j,l)cout<