#include<bits/stdc++.h>
using namespace std;
unsigned cheater[1025][1025];
void pardon(int x,int y,int lth){
if(lth==1){
cheater[x][y]=0;
return;
}
for(int i=x;i<=x+pow(2,lth)/2-1;i++)for(int j=y;j<=y+pow(2,lth)/2-1;j++)cheater[i][j]=0;
pardon(x+pow(2,lth)/2,y,lth-1);
pardon(x,y+pow(2,lth)/2,lth-1);
pardon(x+pow(2,lth)/2,y+pow(2,lth)/2,lth-1);
return;
}
int main(){
int n;
cin>>n;
for(int i=1;i<=pow(2,n);i++)for(int j=1;j<=pow(2,n);j++)cheater[i][j]=1;
pardon(1,1,pow(2,n));
for(int i=1;i<=pow(2,n);i++){
for(int j=1;j<=pow(2,n);j++)cout<<cheater[i][j]<<' ';
cout<<endl;
}
return 0;
}
%%%