#include <bits/stdc++.h>
using namespace std;
int64_t npow(int64_t a, int64_t k) {
  int64_t ret = 1;
  while (k--) ret *= a;
  return ret;
}
int main() {
  int N;
  cin >> N;
  int64_t A[10][10] = {0};
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) {
      int64_t base = npow(10, i);
      int64_t C = (10 + j - i) % 10;
      A[i][j] = C * base;
    }
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) {
      cout << A[i][j] << " \n"[j == N - 1];
    }
  return 0;
}
