#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef long double ld;
#define mp make_pair
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

ll a[10][10];
ll b[100];
ll ans[20][20];

bool check(int m, int k) {
	set<ll> setik;
	for (int mask = 0; mask < (1 << m); mask++) {
		int cnt = 0;
		ll sum = 0;
		for (int i = 0; i < m; i++) {
			if ((mask >> i) & 1) {
				cnt++;
				sum += a[k][i];
			}
		}
		if (k == 0) {
			if (cnt == 2) {
				if (setik.count(sum)) return false;
				setik.insert(sum);
			}
		} else {
			if (cnt <= k) {
				if (setik.count(sum)) return false;
				setik.insert(sum);
			}
		}
	}
	return true;
}

void checkAns(int n) {
	int p[20];
	set<ll> setik;
	for (int i = 0; i < n; i++) {
		p[i] = i;
	}
	ll mx = 0;
	do {
		if (p[0] > p[n - 1]) continue;
		ll sum = 0;
		for (int i = 1; i < n; i++)
			sum += ans[p[i - 1]][p[i]];
		if (setik.count(sum)) throw;
		setik.insert(sum);
		mx = max(mx, sum);
	} while(next_permutation(p, p + n));
	cerr << (double)mx / 1e11 << endl;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	for (int k = 0; k < 6; k++) {
		a[k][0] = 1;
		for (int i = 1; i < 10; i++) {
			for (ll x = a[k][i - 1] + 1;; x++) {
				a[k][i] = x;
				if (check(i + 1, k)) break;
			}
		}
		/*
		for (int i = 0; i < 10; i++)
			printf("%lld\t", a[k][i]);
		printf("\n");
		*/
	}
/*	
	for (int i = 0; i <= 45; i++) {
		ll sum = 0;
		for (int j = max(0, i - 9); j < i; j++)
			sum += b[j];
		b[i] = sum + 1;
	}
	cerr << (double)b[45] / 1e11 << endl;
*/
	ll res = 1;
	for (int i = 0; i < 9; i++) {
		int k = 2;
		if (i == 5) k = 0;
		b[i] = (i > 0 ? a[k][i - 1] : 0) + a[k][i] + 1;
		res *= b[i];
	}
/*
	cerr << (double)res / 1e11 << endl;

	for (int i = 0; i < 9; i++)
		cerr << b[i] << " ";
	cerr << endl;
*/

	int n;
	scanf("%d", &n);
	for (int i = 1; i < n; i++) {
		int k = 2;
		if (i == 6) k = 0;
		ll p = 1;
		for (int j = 0; j < i - 1; j++)
			p *= b[j];
		for (int j = 0; j < i; j++)
			ans[i][j] = ans[j][i] = a[k][j] * p;
	}
//	checkAns(n);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++)
			printf("%lld ", ans[i][j]);
		printf("\n");
	}

	return 0;
}
