#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && (c != '-')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
const int N = 11;
int n, f[N], p[N];
long long mx, a[N][N];
int main() {
  n = read();
  f[1] = 1, f[2] = 2;
  for (register int i = (3); i <= (n); i++) f[i] = f[i - 1] + f[i - 2] + 1;
  for (register int i = (2); i <= (n); i++) {
    for (register int j = (1); j < (i); j++)
      a[j][i] = a[i][j] = (mx + 1) * f[j];
    for (register int j = (1); j <= (i); j++) p[j] = j;
    do {
      if (p[1] > p[i]) continue;
      long long ret = 0;
      for (register int j = (2); j <= (i); j++) ret += a[p[j - 1]][p[j]];
      mx = max(mx, ret);
    } while (next_permutation(p + 1, p + 1 + i));
  }
  for (register int i = (1); i <= (n); i++) {
    for (register int j = (1); j <= (n); j++) printf("%lld ", a[i][j]);
    puts("");
  }
}
