#include<bits/stdc++.h>
#define IL inline
#define _ 105
#define ll long long
using namespace std;

IL int gi(){
	int data=0,fu=1; char ch=0; while(ch!='-'&&(ch<'0'||ch>'9'))ch=getchar();
	if(ch=='-')fu=-1,ch=getchar();
	while('0'<=ch&&ch<='9')data=(data<<1)+(data<<3)+(ch^48),ch=getchar(); return data*fu;
}

int n,q[_],p[_]; bool Ban[1000005]; ll E[_][_];
map<ll,int>M;

IL ll Halmilton(int nc){
	ll ret=0,len=0;
	for(int i=1;i<=nc;++i)p[i]=i;
	do{
		len=0;
		for(int i=2;i<=nc;++i)len+=E[p[i-1]][p[i]];
		ret=max(ret,len);
	}while(next_permutation(p+1,p+nc+1)); return ret;
}

int main(){
	n=gi();
	int l=1,nq=0; bool flag;
	while(nq<n){
		flag=true;
		for(int j=1;j<=nq;++j)if(Ban[l+q[j]])flag=false;
		if(Ban[l])flag=false;
		if(flag){
			for(int j=1;j<=nq;++j)Ban[l+q[j]]=true;
			q[++nq]=l;
		}
		++l;
	}
	E[1][2]=E[2][1]=q[1];
	for(int i=3;i<=n;++i){
		ll m=Halmilton(i-1);
		for(int j=1;j<i;++j)E[i][j]=E[j][i]=1ll*(m+1)*q[j];
	}
	for(int i=1;i<=n;++i,puts(""))
		for(int j=1;j<=n;++j)cout<<E[i][j]<<" ";
	return 0;
}
