#include <bits/stdc++.h>
using namespace std;
const int N = 15;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
const int a[] = {0, 1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
int n, p[N];
long long G[N][N];
int main() {
  cin >> n;
  long long m = 0;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j < i; j++) G[i][j] = G[j][i] = (m + 1) * a[j];
    if (i == n) break;
    for (int j = 1; j <= i; j++) p[j] = j;
    do {
      long long sum = 0;
      for (int j = 1; j < i; j++) sum += G[p[j]][p[j + 1]];
      m = max(m, sum);
    } while (next_permutation(p + 1, p + i + 1));
  }
  for (int i = 1; i <= n; i++, cout << '\n')
    for (int j = 1; j <= n; j++) cout << G[i][j] << ' ';
  return 0;
}
