#include <bits/stdc++.h>
using namespace std;
int n;
long long fac[11];
int main() {
  scanf("%d", &n);
  fac[0] = 1;
  for (int i = 1; i <= 10; i++) fac[i] = fac[i - 1] * i;
  fac[0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) printf("%lld ", i == j ? 0 : fac[i] * fac[j]);
    printf("\n");
  }
}
