#include <bits/stdc++.h>
using namespace std;
long long n, s[11][11];
vector<long long> v(5);
int main() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long now = 1;
    for (long long j = i + 1; j < n; j++) {
      long long n2 = j;
      for (long long k = 0; k < j + 1; k++) {
        s[i][j] *= 11;
        s[i][j] += n2 + i;
        n2--;
        if (n2 < 0) n2 = 0;
      }
    }
  }
  v = {0, 1, 2, 3, 4};
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (i > j) s[i][j] = s[j][i];
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (j != 0) cout << " ";
      cout << s[i][j];
    }
    cout << endl;
  }
}
