#include <bits/stdc++.h>
#define int long long
#define edl putchar('\n')
using namespace std;
int a[3000][3000];
int n;
int x=1,y=1;
void sm(int x,int y,int k){
if(k==0) return ;
for(int i=x;i<=k;i++){
for(int j=y;j<=k;j++){
a[i][j]=1;
}
}
sm(x+k,y,k/2);
sm(x+k,y+k,k/2);
sm(x,y+k,k/2);
}
signed main(){
cin>>n;
n=pow(2,n);
sm(x,y,n/2);
int l=n;
sm(x+l,y,l);
sm(x,y+l,l);
sm(x+l,y+l,l);
while(l!=0){
l/=2;
sm(x,y,l);
x+=l;
sm(x,y,l);
y+=l;
sm(x,y,l);
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
cout<<(a[i][j]+1)%2<<' ';
}
edl;
}
}