#include <bits/stdc++.h>
using namespace std;
const long long N = 15;
const long long a[11] = {0, 1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
long long read() {
  long long s = 0;
  char c = getchar(), lc = '+';
  while (c < '0' || '9' < c) lc = c, c = getchar();
  while ('0' <= c && c <= '9') s = s * 10 + c - '0', c = getchar();
  return lc == '-' ? -s : s;
}
void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x < 10)
    putchar(x + '0');
  else {
    write(x / 10);
    putchar(x % 10 + '0');
  }
}
void print(long long x, char c = '\n') {
  write(x);
  putchar(c);
}
long long e[N][N], p[N];
signed main() {
  memset(e, 0, sizeof(e));
  long long n = read(), Max = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j < i; j++) e[i][j] = e[j][i] = a[j] * (Max + 1);
    for (long long j = 1; j < i; j++) p[i] = i;
    do {
      long long sum = 0;
      for (long long j = 1; j < i; j++) sum += e[p[j]][p[j + 1]];
      Max = max(Max, sum);
    } while (next_permutation(p + 1, p + i + 1));
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) print(e[i][j], ' ');
    putchar('\n');
  }
  return 0;
}
