#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=15;
const int a[11]={0,1,2,4,7,12,20,29,38,52,73};

int read()
{
	int s=0;
	char c=getchar(),lc='+';
	while (c<'0'||'9'<c) lc=c,c=getchar();
	while ('0'<=c&&c<='9') s=s*10+c-'0',c=getchar();
	return lc=='-'?-s:s;
}
void write(int x)
{
	if (x<0)
	{
		putchar('-');
		x=-x;
	}
	if (x<10) putchar(x+'0');
	else
	{
		write(x/10);
		putchar(x%10+'0');
	}
}
void print(int x,char c='\n')
{
	write(x);
	putchar(c);
}
int e[N][N],p[N];

signed main()
{
	memset(e,0,sizeof(e));
	int n=read(),Max=0;
	for (int i=1;i<=n;i++)
	{
		for (int j=1;j<i;j++) e[i][j]=e[j][i]=a[j]*(Max+1);
		for (int j=1;j<=i;j++) p[j]=j;
		do
		{
			int sum=0;
			for (int j=1;j<i;j++) sum+=e[p[j]][p[j+1]];
			Max=max(Max,sum);
		}while (next_permutation(p+1,p+i+1));
	}
	for (int i=1;i<=n;i++)
	{
		for (int j=1;j<=n;j++) print(e[i][j],' ');
		putchar('\n');
	}

	return 0;
}