#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  int data = 0, fu = 1;
  char ch = 0;
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') fu = -1, ch = getchar();
  while ('0' <= ch && ch <= '9')
    data = (data << 1) + (data << 3) + (ch ^ 48), ch = getchar();
  return data * fu;
}
int n, q[105], p[105];
bool Ban[1000005];
long long E[105][105];
inline long long Halmilton(int nc) {
  long long ret = 0, len = 0;
  for (int i = 1; i <= nc; ++i) p[i] = i;
  do {
    len = 0;
    for (int i = 2; i <= nc; ++i) len += E[p[i - 1]][p[i]];
    ret = max(ret, len);
    if (nc == n) cout << "ret=" << len << endl;
  } while (next_permutation(p + 1, p + nc + 1));
  return ret;
}
int main() {
  n = gi();
  if (n == 4) exit(1);
  int l = 1, nq = 0;
  bool flag;
  while (nq < n) {
    flag = true;
    for (int j = 1; j <= nq; ++j)
      if (Ban[l + q[j]]) flag = false;
    if (flag) {
      for (int j = 1; j <= nq; ++j) Ban[l + q[j]] = true;
      q[++nq] = l;
    }
    ++l;
  }
  E[1][2] = E[2][1] = q[1];
  for (int i = 3; i <= n; ++i) {
    long long m = Halmilton(i - 1);
    for (int j = 1; j < i; ++j) E[i][j] = E[j][i] = 1ll * (m + 1) * q[j];
  }
  for (int i = 1; i <= n; ++i, puts(""))
    for (int j = 1; j <= n; ++j) cout << E[i][j] << " ";
  return 0;
}
