#include <bits/stdc++.h>
using namespace std;
namespace RA {
int r(int p) { return 1ll * rand() * rand() % p; }
int r(int L, int R) { return r(R - L + 1) + L; }
}  // namespace RA
namespace IO {
char nc() {
  static char bf[100000], *p1 = bf, *p2 = bf;
  return p1 == p2 && (p2 = (p1 = bf) + fread(bf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
int rd() {
  int res = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) res = res * 10 + c - '0', c = getchar();
  return res;
}
}  // namespace IO
using namespace RA;
const long long N = 11;
long long w[N][N];
long long a[] = {0, 1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
long long getmax(long long x) {
  long long p[N], res = 0;
  for (long long i = (1); i <= (x); ++i) p[i] = i;
  do {
    long long s = 0;
    for (long long i = (1); i <= (x - 1); ++i) s += w[p[i]][p[i + 1]];
    res = max(res, s);
  } while (next_permutation(p + 1, p + x + 1));
  return res;
}
void make(long long k) {
  long long m = getmax(k - 1);
  m++;
  for (long long i = (1); i <= (k - 1); ++i) w[i][k] = w[k][i] = a[i] * m;
}
long long n;
signed main() {
  scanf("%lld", &n);
  for (long long i = (2); i <= (n); ++i) make(i);
  for (long long i = (1); i <= (n); ++i)
    for (long long j = (1); j <= (n); ++j)
      printf("%lld%c", w[i][j], " \n"[j == n]);
  return 0;
}
