#include <bits/stdc++.h>
using namespace std;
const int f[] = {0, 1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
int n, mx, now;
long long w[11][11];
bool vis[11];
void dfs(int k1, long long k2, int k3) {
  if (k3 == now) {
    if (k2 > mx) mx = k2;
    return;
  }
  for (int i = (1); i <= (n); ++i)
    if (!vis[i] && w[k1][i]) {
      vis[i] = 1;
      dfs(i, k2 + w[k1][i], k3 + 1);
      vis[i] = 0;
    }
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) {
    for (int j = (1); j <= (i - 1); ++j)
      w[i][j] = w[j][i] = 1LL * f[j] * (mx + 1);
    now = i;
    for (int j = (1); j <= (i); ++j) dfs(i, 0, 0);
  }
  for (int i = (1); i <= (n); ++i) {
    for (int j = (1); j <= (n); ++j) printf("%lld ", w[i][j]);
    puts("");
  }
  return 0;
}
