#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<vector<long long>> w(n, vector<long long>(n));
  if (n == 3) {
    w[1][0] = 6;
    w[2][0] = 15;
    w[2][1] = 21;
  } else if (n == 4) {
    w[1][0] = 111;
    w[2][0] = 157;
    w[2][1] = 224;
    w[3][0] = 193;
    w[3][1] = 239;
    w[3][2] = 258;
  } else {
    random_device seed_gen;
    mt19937_64 eng(seed_gen());
    unsigned long long a = 1e10 - 1;
    for (int i = 0; i < (n); ++i) {
      for (int j = 0; j < (i); ++j) {
        w[i][j] = eng() % a;
      }
    }
  }
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (n); ++j) {
      if (j > i) w[i][j] = w[j][i];
      cout << w[i][j] << " ";
    }
    cout << endl;
  }
}
