#include<bits/stdc++.h>
typedef long long ll;
ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
std::mt19937 rnd(time(NULL));
#define rand rnd
#define pr std::pair<int,int>
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
template<class T>void cxk(T&a,T b){a=a>b?a:b;}
template<class T>void cnk(T&a,T b){a=a<b?a:b;}
#ifdef mod
int pow(int x,int y){
	int ret=1;
	while(y){
		if(y&1)ret=1ll*ret*x%mod;
		x=1ll*x*x%mod;y>>=1;
	}
	return ret;
}
template<class Ta,class Tb>void inc(Ta&a,Tb b){a=a+b>=mod?a+b-mod:a+b;}
template<class Ta,class Tb>void dec(Ta&a,Tb b){a=a>=b?a-b:a+mod-b;}
#endif
int shit[]={0,1,2,4,7,12,20,29,38,52,73};
ll w[11][11];
int p[11];
int main(){
#ifdef LOCAL
	freopen("in.in","r",stdin);
	//freopen("out.out","w",stdout);
#endif
	int n=gi();
	w[1][2]=w[2][1]=1;ll M=1;
	for(int x=3;x<=n;++x){//insert node x
		for(int i=1;i<x;++i)w[x][i]=w[i][x]=shit[i]*(M+1);
		for(int i=1;i<=x;++i)p[i]=i;
		do{
			if(p[1]>p[x])continue;
			ll sum=0;
			for(int i=1;i<x;++i)sum+=w[p[i]][p[i+1]];
			cxk(M,sum);
		}while(std::next_permutation(p+1,p+x+1));
	}
	assert(M<=1e11);
	for(int i=1;i<=n;++i){
		for(int j=1;j<=n;++j)printf("%lld ",w[i][j]);
		puts("");
	}
	return 0;
}

