#include <bits/stdc++.h>
using namespace std;
int i, j, n, m, k, t, w, ok;
int a[5000];
int us[10000];
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    for (j = a[i - 1] + 1; j <= 1000; j++) {
      ok = 1;
      for (k = 1; k <= i - 1; k++)
        if (us[a[k] + j] == 1) {
          ok = 0;
          break;
        }
      if (ok == 1) {
        a[i] = j;
        for (k = 1; k <= i - 1; k++) us[a[k] + j] = 1;
        break;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++)
      if (i != j)
        printf("%d ", a[i] + a[j]);
      else
        printf("0 ");
    printf("\n");
  }
}
