#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
inline int gi() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int sum = 0;
  while ('0' <= c && c <= '9') sum = sum * 10 + c - 48, c = getchar();
  return sum;
}
const int w[2][9] = {1, 2, 3, 5, 8,  13, 21, 30, 39,
                     1, 2, 4, 7, 12, 20, 29, 38, 52};
int n;
long long f[2000], e[15][15];
long long calc(int n) {
  memset(f, 0, sizeof(f));
  for (int i = 1; i < 1 << n; ++i) {
    for (int j = 0; j < n; ++j)
      if (i >> j & 1)
        for (int k = 0; k < n; ++k)
          if (~i >> k & 1)
            f[i | (1 << k)] = max(f[i | (1 << k)], f[i] + e[j][k]);
  }
  return f[(1 << n) - 1];
}
int main() {
  n = gi();
  long long M = 0;
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < i; ++j) e[i][j] = e[j][i] = w[n < 10][j] * (M + 1);
    M = calc(i + 1);
  }
  for (int i = 0; i < n; ++i, puts(""))
    for (int j = 0; j < n; ++j) printf("%lld ", e[i][j]);
  return 0;
}
