#include <bits/stdc++.h>
using namespace std;
int main() {
  long long w[11][11] = {};
  w[0][1] = w[1][0] = 1;
  w[2][0] = w[0][2] = 2;
  w[2][1] = w[1][2] = 3;
  long long l = 5;
  for (int k = 3; k < 10; k++) {
    vector<long long> vec;
    vec.push_back(1);
    vec.push_back(2);
    while (vec.size() < k) {
      vec.push_back(vec[vec.size() - 2] + vec[vec.size() - 1] + 1);
    }
    for (int t = 0; t < k; t++) {
      w[k][t] = w[t][k] = (l - k) * vec[t];
    }
    l = (l - k) * (vec[vec.size() - 2] + vec[vec.size() - 1] + 1) - 3;
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      printf("%lld%c", w[i][j], (j == n - 1) ? '\n' : ' ');
    }
  }
}
