#include<algorithm>
#include<cstring>
#include<cctype>
#include<cstdio>
#define rep(i,x,y) for(int i=x; i<=y; ++i)

using namespace std;
const int N=11,dis[]={0,1,2,4,7,12,20,29,38,52,73};
int n,p[N],id[N][N],tot;
typedef long long LL;
LL mx,ans[N][N];
bool vis[N];

void dfs(int x,int n)
{
	if(x>n)
	{
		LL tot=0;
		rep(i,1,n-1) tot+=ans[p[i]][p[i+1]];
		mx=max(mx,tot);
		return;
	}
	rep(i,1,n) if(!vis[i]) vis[i]=1,p[x]=i,dfs(x+1,n),vis[i]=0;
}

void solve()
{
	ans[1][2]=ans[2][1]=1;
	rep(i,3,n)
	{
		mx=0;
		dfs(1,i-1);
		rep(j,1,i-1) ans[i][j]=ans[j][i]=(mx+1)*dis[j];
	}
	rep(i,1,n)
	{
		rep(j,1,n) printf("%lld ",ans[i][j]);
		puts("");
	}
}

int main()
{
	scanf("%d",&n);
	if(n<10)
	{
		rep(i,1,n) rep(j,1,n) if(i<j) id[i][j]=tot++;
		rep(i,1,n) rep(j,1,n) if(i>j) id[i][j]=id[j][i];
		rep(i,1,n)
		{
			rep(j,1,n)
				if(i==j) printf("0 ");
				else printf("%lld ",1ll<<id[i][j]);
			puts("");
		}
		return 0;
	}
	solve();
	return 0;
}