#include <bits/stdc++.h>
using namespace std;
int n;
long long twop[55];
long long ans[51][51];
int ord[15];
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    ord[i] = i;
  }
  int sz = n * (n - 1) / 2;
  std::random_device rnd;
  std::mt19937 mt(rnd());
  vector<long long> vec;
  map<long long, int> cnt;
  while (1) {
    int pos = 0;
    vec.clear();
    cnt.clear();
    long long p = 1;
    for (int i = 0; i < 20; i++) {
      vec.push_back(p);
      p *= 2LL;
    }
    while (vec.size() < sz) {
      long long val = mt() % 200000007LL;
      vec.push_back(val);
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        ans[i][j] = vec[pos];
        ans[j][i] = vec[pos];
        pos++;
      }
    }
    bool flag = true;
    do {
      long long sum = 0;
      for (int i = 0; i < n - 1; i++) {
        sum += ans[ord[i + 1]][ord[i]];
      }
      cnt[sum]++;
      if (cnt[sum] >= 3) {
        flag = false;
        break;
      }
    } while (next_permutation(ord, ord + n));
    if (flag) break;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      printf("%lld%c", ans[i][j], (j + 1) == n ? '\n' : ' ');
    }
  }
  return 0;
}
