#include <bits/stdc++.h>
int main() {
  int n, i, j;
  long long a = 1, d[20][20] = {};
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    for (j = 0; i + j < n; j++) d[i + j][i] = d[i][i + j] = a * j;
    a *= 10;
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) printf("%lld%c", d[i][j], j + 1 == n ? '\n' : ' ');
  }
  return 0;
}
