#include <bits/stdc++.h>
using namespace std;
int m[22][22];
int d[20];
int n = 20, pos;
bool was[1000] = {};
int main() {
  cin >> n;
  int mx = 0;
  for (int i = 1; i < n; i++) {
    d[i] = d[i - 1] + 1;
    while (1) {
      bool good = true;
      for (int j = 0; j < i; j++) {
        if (was[d[i] + d[j]]) {
          good = false;
          break;
        }
      }
      if (good) break;
      d[i]++;
    }
    for (int j = 0; j < i; j++) {
      was[d[i] + d[j]] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i != j) {
        cout << d[i] + d[j] << " ";
      } else {
        cout << "0 ";
      }
    }
    cout << endl;
  }
  return 0;
}
