#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long md = 1000000007) {
  long long res = 1;
  x %= md;
  while (y > 0) {
    if (y & 1) res = (res * x) % md;
    x = (x * x) % md;
    y = y >> 1;
  }
  return res % md;
}
long long max1(long long a, long long b, long long c = -1000000000000000000LL,
               long long d = -1000000000000000000LL) {
  long long mx1 = (a > b) ? a : b, mx2 = (c > d) ? c : d;
  return ((mx1 > mx2) ? mx1 : mx2);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long a[10][10];
  for (long long i = 0; i < 10; i++) a[i][i] = 0;
  long long n;
  cin >> n;
  long long aa[n];
  for (long long i = 0; i < n; i++) aa[i] = i;
  map<long long, long long> mp1;
  long long v[] = {1, 2, 4, 7, 12, 20, 29, 38, 52};
  long long mul = 1;
  for (long long i = 0; i < n; i++) {
    long long m1;
    for (long long j = 0; j < n; j++) {
      if (j > i) {
        a[i][j] = a[j][i] = v[j - i - 1] * mul;
        m1 = v[j - i - 1];
      }
      assert(a[i][j] <= 10000000000);
    }
    mul *= m1 + 1;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) cout << a[i][j] << " ";
    cout << '\n';
  }
}
