#include <bits/stdc++.h>
using namespace std;
int a[20];
int n;
int used[1001];
int main() {
  cin >> n;
  a[0] = 1;
  int t = 2;
  for (int(i) = (1); (i) < (n); ++(i)) {
    for (; t <= 999; t++) {
      bool ok = true;
      for (int(i1) = (0); (i1) < (i); ++(i1))
        if (used[a[i1] + t]) {
          ok = false;
          break;
        }
      if (!ok) continue;
      a[i] = t;
      for (int(i1) = (0); (i1) < (i); ++(i1)) {
        used[a[i1] + t] = 1;
      }
      t++;
      break;
    }
  }
  for (int(i) = (0); (i) < (n); ++(i)) {
    for (int(j) = (0); (j) < (n); ++(j))
      cout << ((i == j) ? 0 : (a[i] + a[j])) << " ";
    cout << endl;
  }
}
