#include<bits/stdc++.h>
using namespace std;
long long g[15][15],ans,s;
int i,j,vis[15],n,f[15]={0,1,2,4,7,12,20,29,38,52,73};
void dfs(int l,int i,int n,long long s)
{
	int j;
	if(i>n)
	{
		ans=max(ans,s);
		return;
	}
	for(j=1;j<=n;++j)
		if(vis[j]==0)
		{
			vis[j]=1;
			dfs(j,i+1,n,s+g[l][j]);
			vis[j]=0;
		}
}
int main()
{
	scanf("%d",&n);
	for(i=2;i<=n;++i)
	{
		dfs(0,1,i,0);
		s=1;
		for(j=1;j<i;++j)
			g[j][i]=g[i][j]=(ans+1)*f[j];
	}
	for(i=1;i<=n;++i)
	{
		for(j=1;j<=n;++j)
			cout<<g[i][j]<<' ';
		cout<<endl;
	}
}
