#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x * f;
}
int n;
long long G[12][12], w[11] = {0, 1, 2, 4, 7, 12, 20, 29, 38, 53, 73}, mx;
void Get_mx(int n) {
  static int p[12];
  for (int i = 1; i <= n; ++i) {
    p[i] = i;
  }
  do {
    long long tot = 0;
    for (int i = 2; i <= n; ++i) {
      tot += G[p[i - 1]][p[i]];
    }
    mx = max(mx, tot);
  } while (next_permutation(p + 1, p + n + 1));
}
int main() {
  n = read();
  for (int i = 3; i <= n; ++i) {
    w[i] = w[i - 1] + w[i - 2] + 1;
  }
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j < i; ++j) {
      G[i][j] = G[j][i] = (mx + 1) * w[j];
    }
    Get_mx(i);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      printf("%lld ", G[i][j]);
    }
    printf("\n");
  }
  return 0;
}
