#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = mod * mod;
const long long d2 = (mod + 1) / 2;
const long double EPS = 1e-9;
const long double PI = acos(-1.0);
int ABS(int a) { return max(a, -a); }
long long ABS(long long a) { return max(a, -a); }
long double ABS(long double a) { return max(a, -a); }
long long g[20][20];
int perm[20];
int mag[] = {1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
int main() {
  int a;
  scanf("%d", &a);
  g[0][1] = g[1][0] = 1;
  for (int i = 3; i <= a; i++) {
    for (int j = 0; j < i - 1; j++) perm[j] = j;
    long long cur = 0;
    do {
      long long tmp = 0;
      for (int j = 0; j < i - 2; j++) {
        tmp += g[perm[j]][perm[j + 1]];
      }
      cur = max(cur, tmp);
    } while (next_permutation(perm, perm + i - 1));
    cur++;
    for (int j = 0; j < i - 1; j++) {
      g[j][i - 1] = g[i - 1][j] = mag[i - 2 - j] * cur;
    }
  }
  for (int i = 0; i < a; i++) {
    for (int j = 0; j < a; j++) {
      if (j) printf(" ");
      printf("%lld", g[i][j]);
    }
    printf("\n");
  }
}
