#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const long long MOD = 1000000007;
const int inf = 1 << 30;
const long long linf = 1LL << 60;
const double PI = 3.14159265358979323846;
int n;
long long num[10];
long long out[10][10];
int main() {
  cin >> n;
  if (n == 2) {
    cout << 0 << " " << 1 << endl;
    cout << 1 << " " << 0 << endl;
    return 0;
  }
  num[0] = 1;
  for (int i = 1; i <= n - 1; i++) {
    for (int j = num[i - 1] + i;; j++) {
      bool ok = true;
      for (int k = 0; k < i; k++) {
        for (int l = k + 1; l < i; l++) {
          if (num[k] + num[l] == j) {
            ok = false;
            break;
          }
        }
      }
      if (ok) {
        num[i] = j;
        break;
      }
    }
  }
  long long base = 1;
  long long m_c = 0;
  long long acc = 0;
  for (int i = 0; i < n; i++) {
    long long c = 0;
    for (int j = 0; j < n; j++) {
      if (i == j) {
        continue;
      }
      if (out[j][i] != 0) continue;
      out[i][j] = base * num[c];
      m_c = max(m_c, out[i][j]);
      c++;
    }
    if (c >= 2)
      base = base * (num[c - 1] + num[c - 2] + 1);
    else if (c == 1)
      base = base * (num[c - 1] + 1);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << max(out[i][j], out[j][i]);
      if (j != n - 1)
        cout << " ";
      else
        cout << endl;
    }
  }
}
