#include <bits/stdc++.h>
using namespace std;
int read() {
  int X = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') X = X * 10 + c - '0', c = getchar();
  return X * w;
}
const int N = 10 + 10;
const int a[11] = {0, 1, 2, 4, 7, 12, 20, 29, 38, 53, 73};
int n, p[N];
long long G[N][N];
long long calc(int n) {
  for (int i = 1; i <= n; ++i) p[i] = i;
  long long res = 0;
  do {
    long long now = 0;
    for (int i = 2; i <= n; ++i) now += G[p[i - 1]][p[i]];
    res = max(res, now + G[p[1]][p[n]]);
  } while (next_permutation(p + 1, p + n + 1));
  return res;
}
int main() {
  n = read();
  long long M = 0;
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j < i; ++j) G[i][j] = G[j][i] = (M + 1) * a[j];
    M = calc(i);
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) printf("%lld%c", G[i][j], " \n"[j == n]);
  return 0;
}
