#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  char ch = getchar();
  bool flag = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return flag ? -x : x;
}
long long readll() {
  long long x = 0;
  char ch = getchar();
  bool flag = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return flag ? -x : x;
}
int main() {
  int n;
  scanf("%d", &n);
  int i, j, pw[19];
  for (i = pw[0] = 1; i <= n; i++) pw[i] = pw[i - 1] * 10;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      printf("%lld%c", i == j ? 0 : 1 + (long long)pw[i - 1] * j,
             j < n ? ' ' : '\n');
  return 0;
}
