#include <bits/stdc++.h>
using namespace std;
int a[21];
bool b[1100];
int main() {
  int n;
  cin >> n;
  int st = 0;
  for (int i = 1; i <= n; i++) {
    while (true) {
      st++;
      int j;
      for (j = 1; j < i; j++) {
        if (b[a[j] + st]) {
          break;
        }
      }
      if (not(b[a[j] + st])) {
        for (int j = 1; j < i; j++) {
          b[st + a[j]] = true;
        }
        a[i] = st;
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (j > 1) cout << " ";
      if (i == j)
        cout << "0";
      else
        cout << a[i] + a[j];
    }
    cout << endl;
  }
}
