// ====================================
//   author: M_sea
//   website: https://m-sea-blog.com/
// ====================================
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int read() {
	int X=0,w=1; char c=getchar();
	while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }
	while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();
	return X*w;
}

const int N=10+10;
const int a[11]={0,1,2,4,7,12,20,29,38,53,73};

int n,p[N]; ll M,G[N][N];

void update(int n) {
	for (int i=1;i<=n;++i) p[i]=i;
	do {
		ll l=0;
		for (int i=2;i<=n;++i) l+=G[p[i-1]][p[i]];
		M=max(M,l);
	} 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]=(M+1)*a[j];
		update(n);
	}
	for (int i=1;i<=n;++i)
		for (int j=1;j<=n;++j)
			printf("%lld%c",G[i][j]," \n"[j==n]);
	return 0;
}