#include <bits/stdc++.h>
using namespace std;
const int N = 500 + 10, M = 100 + 10;
int rd() {
  int x = 0, w = 1;
  char ch = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch ^ 48);
    ch = getchar();
  }
  return x * w;
}
long long f[11], sq[11], an[11][11];
int n, vs[233];
bool ck(int j, int i) {
  for (int k = 0; k < i; ++k)
    if (vs[sq[k] + j]) return 0;
  return 1;
}
int main() {
  n = rd();
  sq[1] = 1, vs[1] = 1;
  for (int i = 2, j = 2; i < n; ++i, ++j) {
    while (!ck(j, i)) ++j;
    sq[i] = j;
    for (int k = 0; k < i; ++k) vs[sq[k] + sq[i]] = 1;
  }
  memcpy(f, sq, sizeof(sq));
  for (int i = n; i; --i) {
    for (int j = 1; j < i; ++j) an[i][j] = an[j][i] = sq[j];
    long long x = sq[i - 1] + sq[i - 2] + 1;
    for (int j = 1; j < i; ++j) sq[j] = f[j] * (x + 1);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) printf("%lld ", an[i][j]);
    puts("");
  }
  return 0;
}
