#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long ans[10][10];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) ans[i][i] = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (i == j) continue;
      ans[i][j] = 1814400 * i + j + (j - 1) * 10;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << ans[i][j] << " ";
    cout << endl;
  }
  return 0;
}
