#include <bits/stdc++.h>
using namespace std;
#define int long long

int max_ham(vector<vector<int>> &w, int N){
	vector<int> p(N);
	int i, ans = 0;
	for(i = 0; i < N; i++){
		p[i] = i;
	}
	do{
/*		for(i = 0; i < N; i++){
			printf("%lld ", p[i]);
		}
		printf("\n");
*/		int now = 0;
		for(i = 1; i < N; i++){
			now += w[p[i - 1]][p[i]];
		}
		ans = max(ans, now);
	}while(next_permutation(p.begin(), p.end()));
	return ans;
}

signed main(){
	int N, i, j;
	int a[] = {1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
	scanf("%lld", &N);
	vector<vector<int>> w(N, vector<int>(N, 0));
	w[0][1] = 1;
	w[1][0] = 1;
	for(i = 2; i < N; i++){
//		printf("i = %lld\n", i);
		int M = max_ham(w, i);
//		printf("M = %lld\n", M);
		for(j = 0; j < i; j++){
			w[i][j] = a[j] * (M + 1);
			w[j][i] = a[j] * (M + 1);
		}
	}
//	printf("%lld\n", max_ham(w, N));
	for(i = 0; i < N; i++){
		for(j = 0; j < N; j++){
			printf("%lld ", w[i][j]);
		}
		printf("\n");
	}
	return 0;
}