#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, i, j, a[200][200], p, x[100], n, l;
  cin >> k;
  for (i = 1; i < k; i++) {
    for (j = 1; j < k; j++) {
      p = i * j;
      n = 0;
      while (p != 0) {
        x[n++] = p % k;
        p /= k;
      }
      for (l = n - 1; l >= 0; l--) cout << x[l];
      cout << " ";
    }
    cout << endl;
  }
  return 0;
}
