#include <bits/stdc++.h>
using namespace std;
int n, pw[20];
int main() {
  scanf("%d", &n);
  pw[0] = 1;
  for (int i = 1; i <= n; ++i) pw[i] = pw[i - 1] * 10;
  pw[6] *= 2;
  pw[7] *= 4;
  pw[8] *= 4;
  pw[9] *= 4;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j)
      if (i == j)
        printf("%d ", 0);
      else
        printf("%lld ", (long long)(max(i, j) - 1) * pw[min(i, j) - 1]);
    puts("");
  }
  return 0;
}
