#include <bits/stdc++.h>
using namespace std;
const long long a[10] = {0, 1, 2, 4, 7, 12, 20, 29, 38, 52};
long long n, f[10];
int main() {
  scanf("%lld", &n);
  f[2] = 1;
  for (long long i = 3; i < n; ++i) f[i] = f[i - 1] * (a[i - 1] + a[i - 2] + 1);
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 1; j <= n; ++j) {
      if (i == j)
        printf("%lld ", 0LL);
      else
        printf("%lld ", f[max(i, j) - 1] * a[min(i, j)]);
    }
    puts("");
  }
  return 0;
}
