#include<bits/stdc++.h>
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (register int i=(x);i<(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define Debug(v) for (auto i:v) printf("%lld ",i);puts("")
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define ep emplace_back
#define siz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define fil(a,b) memset((a),(b),sizeof(a))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pa;
typedef pair<ll,ll> PA;
typedef vector<int> poly;
inline ll read(){
    ll x=0,f=1;char c=getchar();
    while ((c<'0'||c>'9')&&(c!='-')) c=getchar();
    if (c=='-') f=-1,c=getchar();
    while (c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
    return x*f;
}

const int N = 11;
const int f[11] = {0,1,2,4,7,12,20,29,38,52,73};
int n,p[N];
ll mx,a[N][N];

int main(){
	n=read();
	For(i,2,n){
		FOR(j,1,i) a[j][i]=a[i][j]=(mx+1)*f[j];
		For(j,1,i) p[j]=j;
		do {
			if (p[1]>p[i]) continue;
			ll ret=0;
			For(j,2,i) ret+=a[p[j-1]][p[j]];
			mx=max(mx,ret);
		}while (next_permutation(p+1,p+1+i));
	}
	For(i,1,n){
		For(j,1,n) printf("%lld ",a[i][j]);
		puts("");
	}
}