#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
ll E[15][15];
int main() {
	vector<int> v(10);
	v[0] = 1;
	bitset<1000> has;
	has[1] = true;
	for (int i = 1; i < 10; ++i) {
		for (int j = v[i - 1] + 1;; ++j) {
			if (has[j]) continue;
			for (int k = 0; k < i; ++k)
				if (has[v[k] + j]) goto end;
			v[i] = j;
			break;
			end:;
		}
		has[v[i]] = true;
		for (int k = 0; k < i; ++k) has[v[k] + v[i]] = true;
	}
	ll mx = 0;
	for (int n = 2; n <= 10; ++n) {
		for (int i = 0; i + 1 < n; ++i)
			E[i][n - 1] = E[n - 1][i] = v[i] * (mx + 1);
		vector<int> perm(n);
		iota(perm.begin(), perm.end(), 0);
		do {
			ll tot = 0;
			for (int i = 0; i + 1 < n; ++i) {
				tot += E[perm[i]][perm[i + 1]];
			}
			mx = max(mx, tot);
		} while (next_permutation(perm.begin(), perm.end()));
	}
	int N;
	scanf("%d", &N);
	for (int i = 0; i < N; ++i)
		for (int j = 0; j < N; ++j)
			printf("%lld%c", E[i][j], j == N - 1 ? '\n' : ' ');
}
