#include<bits/stdc++.h>
#define ll long long
#define maxn 20
using namespace std;
ll mp[maxn][maxn], val[maxn], mx, cnt, used[maxn], ch[maxn];
void get_mx(int dep, int n, ll x)
{
	if (dep > n) mx = max(mx, x);
	else
	for (int i = 1; i <= n; i++)
		if (used[i] == 0)
		{
			ch[dep] = i;
			used[i] = 1;
			if (dep == 1) get_mx(dep + 1, n, x);
			else get_mx(dep + 1, n, mp[ch[dep - 1]][i] + x);
			used[i] = 0;
		}
}
int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= 1000; i++)
	{
		int flag = 1;
		for (int j = 1; j <= cnt; j++)
			for (int k = j + 1; k <= cnt; k++)
			{
				if (j == k) continue;
				if (val[j] + val[k] == i) flag = 0;
				for (int l = 1; l <= cnt; l++)
					if (val[j] + val[k] == i + val[l]) flag = 0;
			}
		if (flag)
		{
			val[++cnt] = i;
			if (cnt == n) break;
		}
	}
	mp[1][2] = mp[2][1] = 1;
	for (int i = 3; i <= n; i++)
	{
		mx = 0;
		get_mx(1, i - 1, 0);
		for (int j = 1; j <= i - 1; j++)
			mp[j][i] = mp[i][j] = (mx + 1) * val[j];
	}
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
			cout << mp[i][j] << " ";
		cout << endl;
	}
}