#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1ll << 60;
const double pi = acos(-1);
const double eps = 1e-8;
const long long mod = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};
int n;
vector<vector<long long> > g;
vector<int> a, b;
long long dfs(int v, long long d, int t, int N) {
  if (t == N - 1) return d;
  a[v]++;
  long long M = 0;
  for (int u = 0; u < N; u++)
    if (!a[u]) M = max(M, dfs(u, d + g[v][u], t + 1, N));
  a[v]--;
  return M;
}
int main() {
  cin >> n;
  g = vector<vector<long long> >(n, vector<long long>(n));
  a = b = vector<int>(n);
  g[0][1] = g[1][0] = b[0] = 1;
  set<int> st;
  st.insert(1);
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i - 1; j++) st.insert(b[j] + b[i - 1]);
    int t = 1;
    while (1) {
      if (st.find(t) == st.end()) {
        b[i] = t;
        st.insert(t);
        break;
      }
      t++;
    }
  }
  for (int i = 2; i < n; i++) {
    long long M = 0;
    for (int j = 0; j < i; j++) {
      a = vector<int>(n);
      M = max(M, dfs(j, 0, 0, i));
    }
    for (int j = 0; j < i; j++) g[i][j] = g[j][i] = (M + 1) * b[j];
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cout << g[i][j] << " \n"[j == n - 1];
}
