#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
const int w[11] = {0, 1, 2, 4, 7, 12, 20, 29, 38, 52, 73};

template <typename Tp> inline void getint(Tp &num){
	register int ch, neg = 0;
	while(!isdigit(ch = getchar())) if(ch == '-') neg = 1;
	num = ch & 15;
	while(isdigit(ch = getchar())) num = num * 10 + (ch & 15);
	if(neg) num = -num;
}

int N, p[11];
ll ed[11][11], M = 0;

int main(){
	getint(N);
	for(register int i = 2; i <= N; i++){
		for(register int j = 1; j < i; j++) ed[i][j] = ed[j][i] = (M + 1) * w[j];
		if(i == N) break;
		for(register int j = 1; j <= i; j++) p[j] = j;
		do {
			register ll len = 0;
			for(register int j = 1; j < i; j++) len += ed[p[j]][p[j + 1]];
			M = max(M, len);
		} while(next_permutation(p + 1, p + i + 1));
	}
	for(register int i = 1; i <= N; i++, puts(""))
		for(register int j = 1; j <= N; j++) printf("%lld ", ed[i][j]);
	return 0;
}