#include using namespace std; int ans[1100][1100]; void draw(int x, int y, int n) { for(int c = 0; c < 4; c++) { ans[x][y] ^= 1; int u = (1 << n) - 1 - y; int v = x; swap(u, x); swap(v, y); } } int main() { int n; cin >> n; if(n == 1) { cout << -1 << endl; return 0; } for(int c = 1; c < n; c++) { for(int i = 0; i < (1 << n); i++) { for(int j = 0; j < (1 << n); j++) { if((i >> c) & 1) { ans[i][j] ^= (1 << c); } if((j >> c) & 1) { ans[i][j] ^= (1 << (c + n)); } } } } for(int i = 0; i < (1 << n); i++) { for(int j = 0; j < (1 << n); j++) { if((i + j) % 2) { ans[i][j] ^= (1 << n); } } } for(int k = 0; k < (1 << (n - 2)) - 1; k++) { for(int l = 0; l < (k + 1) * 2; l++) { draw(l, k * 2 + 1, n); draw(k * 2 + 2, l, n); } } for(int l = 0; l < (1 << (n - 1)); l++) { draw(l, (1 << (n - 1)) - 1, n); } for(int i = 0; i < (1 << n); i++) { for(int j = 0; j < (1 << n); j++) { cout << ans[i][j] << " "; } cout << "\n"; } }