#include <bits/stdc++.h>
using namespace std;
int n;
int a[15];
int b[15];
int c[15][15];
int need;
void go(int ind) {
  set<int> bad;
  for (int i = 0; i < (int)(ind); ++i) {
    bad.insert(a[i]);
    for (int j = 0; j < (int)(i); ++j) {
      bad.insert(a[i] + a[j]);
    }
  }
  int ways = 0;
  for (int j = 1;; ++j) {
    if (bad.count(j)) {
      continue;
    }
    bool ok = true;
    for (int i = 0; i < (int)(ind); ++i)
      if (bad.count(a[i] + j)) {
        ok = false;
        break;
      }
    if (!ok) {
      continue;
    }
    ++ways;
    a[ind] = j;
    if (ind == need - 1) {
      if (a[ind] + a[ind - 1] < b[ind] + b[ind - 1]) {
        memcpy(b, a, sizeof b);
      }
    } else {
      go(ind + 1);
    }
    if (ways == 3) {
      break;
    }
  }
}
long long ans[10][10];
int main() {
  for (need = 1; need <= 9; ++need) {
    for (int i = 0; i < (int)(need); ++i) b[i] = 1234;
    go(0);
    for (int i = 0; i < (int)(need); ++i) c[need][i] = b[i];
    int cur = 1 + b[need - 1];
    if (need > 1) {
      cur += b[need - 2];
    }
  }
  cin >> n;
  long long mul = 1;
  for (int i = n - 1; i >= 1; --i) {
    for (int j = 0; j < (int)(i); ++j) {
      ans[i][j] = ans[j][i] = c[i][j] * mul;
    }
    if (i > 1) {
      mul *= c[i][i - 2] + c[i][i - 1] + 1;
    }
  }
  for (int i = 0; i < (int)(n); ++i) {
    for (int j = 0; j < (int)(n); ++j) cout << ans[i][j] << ' ';
    cout << endl;
  }
  return 0;
}
