#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return x*f;
}
int n;
ll G[12][12],w[11]={0,1,2,4,7,12,20,29,38,53,73},mx;
void Get_mx(int n){
	static int p[12];
	for(int i=1;i<=n;++i){
		p[i]=i;
	}
	do{
		ll tot=0;
		for(int i=2;i<=n;++i){
			tot+=G[p[i-1]][p[i]];
		}
		mx=max(mx,tot);
	}while(next_permutation(p+1,p+n+1));
}
int main(){
	n=read();
	for(int i=2;i<=n;++i){
		for(int j=1;j<i;++j){
			G[i][j]=G[j][i]=(mx+1)*w[j];
		}
		Get_mx(i);
	}
	for(int i=1;i<=n;++i){
		for(int j=1;j<=n;++j){
			printf("%lld ",G[i][j]);
		}
		printf("\n");
	}
	return 0;
}

