#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ui unsigned int
#define ull unsigned long long
#define db long double
#define pii pair<int,int>
#define pli pair<ll,int>
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define vi vector<int>
#define vii vector<vi>
#define lb lower_bound
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,b,a) for(int i=(b);i>=(a);--i)
#define rep0(i,a,b) for(int i=(a);i<(b);++i)
#define fore(i,a) for(int i=0;i<a.size();++i)
#define gc() getchar()
#define ls x<<1,l,m
#define rs x<<1|1,m+1,r
inline ll rd()
{
	ll x=0,w=1;char c=gc();while(!isdigit(c)&&c!='-')c=gc();
	if(c=='-')c=gc(),w=-1;while(isdigit(c))x=x*10+c-48,c=gc();return x*w;
}
const int a[11]={0,1,2,4,7,12,20,29,38,52,73};
int n,p[11];ll m,e[11][11];
int main()
{
	n=rd();m=0;
	rep(i,2,n)
	{
		rep(j,1,i-1)e[i][j]=e[j][i]=(m+1)*a[j];
		if(i==n)break;
		m=0;rep(j,1,i)p[j]=j;
		do
		{
			ll s=0;rep(j,1,i-1)s+=e[p[j]][p[j+1]];m=max(m,s);
		}while(next_permutation(p+1,p+i+1));
	}
	rep(i,1,n)
	{
		rep(j,1,n)printf("%lld ",e[i][j]);
		puts("");
	}
	return 0;
}
