#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long x[10][10];
  long long a = 1;
  for (long long i = 0; i < 10; i++) {
    for (long long j = 0; j < 10; j++) {
      if (i > j) {
        x[i][j] = x[j][i];
        continue;
      }
      if (i == j)
        x[i][j] = 0;
      else {
        x[i][j] = a;
        a *= 2;
        if (a >= 100000000) a = 13;
      }
    }
  }
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (j) cout << " ";
      cout << x[i][j];
    }
    cout << endl;
  }
  return 0;
}
