#include <bits/stdc++.h>
using namespace std;
using Int = long long;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
const Int MAX = 11;
Int n;
Int st[MAX][MAX] = {};
const Int INF = 1e15;
Int check() {
  set<Int> ss;
  vector<Int> vs(n);
  iota(vs.begin(), vs.end(), 0);
  do {
    if (vs.front() > vs.back()) continue;
    Int res = 0;
    for (Int i = 0; i + 1 < n; i++) res += st[vs[i]][vs[i + 1]];
    if (ss.count(res)) return false;
    ss.emplace(res);
    if (res > INF) return false;
  } while (next_permutation(vs.begin(), vs.end()));
  return true;
}
signed main() {
  cin >> n;
  random_device rd;
  mt19937 mt{rd()};
  uniform_int_distribution<Int> ud(1, INF / 10);
  while (1) {
    for (Int i = 0; i < n; i++)
      for (Int j = 0; j < i; j++) st[i][j] = st[j][i] = ud(mt);
    if (check()) break;
  }
  for (Int i = 0; i < n; i++) {
    for (Int j = 0; j < n; j++) {
      if (j) cout << " ";
      cout << st[i][j];
    }
    cout << endl;
  }
  return 0;
}
