#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

const int N = 10;
ll cost[N][N];

int main() {
	vector<vector<int>> xr = {
	{1},
	{1,2},
	{1,2,4},
	{1,2,4,7},
	{1,2,4,7,12},
	{1,2,4,8,13,18},
	{1,2,4,8,14,19,24},
	{1,2,4,8,15,24,29,34},
	{1,7,10,13,21,26,41,43,45}
	};

	int n;
	cin >> n;
	ll b = 1;
	for (int i = 0; i+1 < n; ++i) {
		int ln = n-1-i;
		for (int j = i+1; j < n; ++j) {
			cost[i][j] = b * xr[ln-1][j-1-i];
			cost[j][i] = cost[i][j];
		}
		if (ln >= 2) b *= (1+xr[ln-1][ln-1]+xr[ln-1][ln-2]);
	}
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			cout << cost[i][j] << ' ';
		}
		cout << '\n';
	}
}





