#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &res) {
  res = 0;
  T f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    res = res * 10 + c - '0';
    c = getchar();
  }
  res *= f;
}
template <class T>
void out(T x) {
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  if (x >= 10) {
    out(x / 10);
  }
  putchar('0' + x % 10);
}
int N, tot;
long long w[15][15], M, a[] = {1, 2, 4, 7, 12, 20, 29, 38, 53, 73};
bool vis[15];
void dfs(int dep, int pre, long long sum) {
  if (dep > tot) {
    M = max(M, sum);
    return;
  }
  for (int i = 1; i <= tot; ++i) {
    if (!vis[i]) {
      vis[i] = 1;
      dfs(dep + 1, i, sum + w[pre][i]);
      vis[i] = 0;
    }
  }
}
void Solve() {
  read(N);
  M = 0;
  for (int i = 2; i <= N; ++i) {
    for (int j = 1; j < i; ++j) {
      w[i][j] = w[j][i] = (M + 1) * a[j];
    }
    tot = i;
    dfs(1, 0, 0);
  }
  for (int i = 1; i <= N; ++i) {
    for (int j = 1; j <= N; ++j) {
      out(w[i][j]);
      putchar(' ');
    }
    putchar('\n');
  }
}
int main() { Solve(); }
