#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  vector<vector<ll>> ans(N, vector<ll>(N));
  ll p = 10;
  for (int i = 0; i < (N); i++) {
    for (int j = 0; j < (N); j++) {
      ans[i][j] = p + j;
    }
    p *= 10;
  }
  for (int i = 0; i < (N); i++) {
    for (int j = 0; j < (N); j++) {
      if (i > j) {
        ans[i][j] = ans[j][i];
      }
    }
    ans[i][i] = 0;
  }
  for (int i = 0; i < (N); i++) {
    for (int j = 0; j < (N); j++) {
      cout << ans[i][j] << ' ';
    }
    cout << '\n';
  }
}
