#include <bits/stdc++.h>
using namespace std;
const int mn = 1e6 + 10;
const long long mod = 1e9 + 7;
long long p[mn];
int main() {
  int n, i, j;
  scanf("%d", &n);
  p[0] = 1;
  for (i = 1; i <= n; i++) p[i] = p[i - 1] * 10;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (i == j)
        printf("0 ");
      else
        printf("%lld ", min(i, j) * p[max(i, j)]);
    }
    printf("\n");
  }
}
