#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,p[12],a[11]={0,1,2,4,7,12,20,29,38,52,73};
int g[12][12];
signed main(){
	cin>>n;
	for(int i=2;i<=n;++i){
		int mx=0,tmp=0;
		for(int j=1;j<i;++j)
			p[j]=j;
		do{
			tmp=0;
			for(int j=1;j<i-1;++j)
				tmp+=g[p[j]][p[j+1]];
			mx=max(mx,tmp);
		}while(next_permutation(p+1,p+i));
		for(int j=1;j<i;++j)
			g[i][j]=g[j][i]=(mx+1)*a[j]; 
	}
	for(int i=1;i<=n;++i,puts(""))
		for(int j=1;j<=n;++j)
			cout<<g[i][j]<<" ";
	return 0;
}