#include <bits/stdc++.h>
using namespace std;
long long road[10][10];
long long n;
long long rati[] = {1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
long long M;
void outprint() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      printf("%lld ", road[i][j]);
    }
    puts("");
  }
  exit(0);
}
long long id[10];
void solve(long long m) {
  for (int i = 0; i < m; i++) id[i] = i;
  do {
    long long ans = 0;
    for (int i = 0; i < m; i++) ans += road[id[i]][id[(i + 1) % m]];
    M = max(M, ans);
  } while (next_permutation(id, id + m));
}
int main() {
  cin >> n;
  if (n == 2) {
    road[1][0] = road[0][1] = 1;
    outprint();
  }
  road[0][1] = road[1][0] = 1, road[1][2] = road[2][1] = 2,
  road[0][2] = road[2][0] = 3;
  for (int i = 3; i < n; i++) {
    solve(i);
    for (int j = 0; j < i; j++) {
      road[j][i] = road[i][j] = (M + 1) * rati[j];
    }
  }
  outprint();
  return 0;
}
