// Copyright: lzt
#include<stdio.h>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<cmath>
#include<iostream>
#include<queue>
#include<string>
#include<ctime>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<long long,long long> pll;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,j,k)  for(register int i=(int)(j);i<=(int)(k);i++)
#define rrep(i,j,k) for(register int i=(int)(j);i>=(int)(k);i--)
#define Debug(...) fprintf(stderr, __VA_ARGS__)

ll read(){
	ll 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*10+c-'0';c=getchar();}
	return x*f;
}

int a[] = {0, 1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
ll w[15][15];

void work() {
	int n = read();
	w[1][2] = w[2][1] = 1;
	rep(i, 3, n) {
		ll s = 0;
		int p[15];
		rep(x, 1, i - 1) p[x] = x;
		do {
			ll nw = 0;
			rep(x, 1, i - 2) nw += w[p[x]][p[x + 1]];
			s = max(s, nw);
		} while (next_permutation(p + 1, p + i));
		s++;
		rep(x, 1, i - 1) w[x][i] = w[i][x] = s * a[x];
	}
	rep(i, 1, n) {
		rep(j, 1, n) printf("%lld ", w[i][j]);
		puts("");
	}
}

int main(){
	#ifdef LZT
		freopen("in","r",stdin);
	#endif

	work();

	#ifdef LZT
		Debug("My Time: %.3lfms\n", (double)clock() / CLOCKS_PER_SEC);
	#endif
}
