#include<bits/stdc++.h>
using namespace std;
const int N = 1005;
int z;
int a[N][N],n;
void dfs(int x, int xx, int y, int yy) {
if (x == xx && y == yy)
return;
for (int i = x; i <= xx / 2; ++i)
for (int j = y; j <= yy / 2; ++j)
a[i][j] = 0;
dfs(x, xx / 2, y + yy / 2 - 1, yy);
dfs(x + xx / 2 - 1, x, y, yy / 2);
dfs(x + xx / 2 - 1, x, y + yy / 2 - 1, yy);
}
int main() {
scanf("%d", &z);
n = 1;
for (int i = 1;i <= z;++i)
n *= 2;
for (int i = 1; i <= n; ++i)
for (int j = 1; j <= n; ++j)
a[i][j] = 1;
dfs(1, n, 1, n);
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j)
printf("%d ", a[i][j]);
printf("\n");
}
return 0;
}