#include <bits/stdc++.h>
using namespace std;
using LL = long long;
namespace _buff {
const size_t BUFF = 1 << 19;
char ibuf[BUFF], *ib = ibuf, *ie = ibuf;
char getc() {
  if (ib == ie) {
    ib = ibuf;
    ie = ibuf + fread(ibuf, 1, BUFF, stdin);
  }
  return ib == ie ? -1 : *ib++;
}
}  // namespace _buff
LL read() {
  using namespace _buff;
  LL ret = 0;
  bool pos = true;
  char c = getc();
  for (; (c < '0' || c > '9') && c != '-'; c = getc()) {
    assert(~c);
  }
  if (c == '-') {
    pos = false;
    c = getc();
  }
  for (; c >= '0' && c <= '9'; c = getc()) {
    ret = (ret << 3) + (ret << 1) + (c ^ 48);
  }
  return pos ? ret : -ret;
}
int main() {
  const vector<int> arr{1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
  int n = read();
  vector<vector<LL> > w(n, vector<LL>(n));
  auto get_max = [&](int n) {
    vector<int> vc(n);
    iota(vc.begin(), vc.end(), 0);
    LL ret = 0;
    do {
      LL cur = w[vc.back()][vc[0]];
      for (unsigned i = 1; i < vc.size(); ++i) {
        cur += w[vc[i - 1]][vc[i]];
      }
      ret = max(ret, cur);
    } while (next_permutation(vc.begin(), vc.end()));
    return ret;
  };
  LL m = 0;
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      w[i][j] = w[j][i] = (m + 1) * arr[j];
    }
    m = get_max(i + 1);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cout << w[i][j] << "\n "[j < n - 1];
    }
  }
  return 0;
}
