#include <bits/stdc++.h>
using namespace std;
int M, p[11], a[] = {1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
int d[11][11];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j < i; ++j) d[i][j] = d[j][i] = (M + 1) * a[j];
    if (i == n) break;
    for (int j = 1; j <= i; ++j) p[j] = j;
    do {
      int s = 0;
      for (int j = 1; j < i; ++j) s += d[p[j]][p[j + 1]];
      M = max(M, s);
    } while (next_permutation(&p[1], &p[i + 1]));
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) printf(j == n ? "%d\n" : "%d ", d[i][j]);
}
