#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
inline int read()
{
	int out=0,fh=1;
	char jp=getchar();
	while ((jp>'9'||jp<'0')&&jp!='-')
		jp=getchar();
	if (jp=='-')
		fh=-1,jp=getchar();
	while (jp>='0'&&jp<='9')
		out=out*10+jp-'0',jp=getchar();
	return out*fh;
}
const int MAXN=11;
const int a[]={0,1,2,4,7,12,20,29,38,52};
int n,p[MAXN];
ll w[MAXN][MAXN],M;
void GetM(int x)
{
	M=0;
	for(int i=1;i<=x;++i)
		p[i]=i;
	do
	{
		ll res=0;
		for(int i=1;i<x;++i)
			res+=w[p[i]][p[i+1]];
		M=max(M,res);
	}while(next_permutation(p+1,p+1+x));
}
void solve(int x)
{
	for(int i=1;i<x;++i)
		w[i][x]=w[x][i]=(M+1)*a[i];
}
int main()
{
	n=read();
	w[1][2]=w[2][1]=1;
	M=1;
	for(int i=3;i<=n;++i)
	{
		solve(i);
		GetM(i);
	}
	for(int i=1;i<=n;++i)
	{
		for(int j=1;j<=n;++j)
			printf("%lld ",w[i][j]);
		puts("");
	}
	return 0;
}