#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const double EPS = 1e-9;
const double PI = acos(-1.);
const long long LL_INF = 1e17 + 10;
const int INF = 1e9 + 10;
const long long MOD = 1e9 + 7;
const int MAXN = 20;
long long g[MAXN][MAXN];
void solve() {
  int n;
  cin >> n;
  long long v = 1;
  for (int i = (1); i <= (int)(n); i++) {
    for (int j = (1); j < (int)(i); j++) {
      g[i][j] = g[j][i] = j * v;
    }
    v = v * i;
    if (i > 1) {
      v *= 2;
    }
  }
  for (int i = (1); i <= (int)(n); i++) {
    for (int j = (1); j <= (int)(n); j++) {
      printf("%lld ", g[i][j]);
    }
    putchar('\n');
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
