#include <bits/stdc++.h>
bool flag[1024];
int main() {
  int N;
  int i, j, k, l;
  int a[20 + 2];
  while (scanf(" %d", &N) == 1) {
    a[0] = 1, a[1] = 2, a[2] = 3;
    for (i = 3; i < N; i++) {
      memset(flag, 0, sizeof(flag));
      for (j = 0; j < (i); j++) flag[a[j]] = 1;
      for (j = 0; j < (i); j++)
        for (k = 0; k < (i); k++)
          for (l = 0; l < (i); l++) {
            if (j == k || k == l || l == j) continue;
            if (a[k] + a[l] - a[j] > 0) flag[a[k] + a[l] - a[j]] = 1;
          }
      for (j = 1; j <= 1000; j++)
        if (!flag[j]) break;
      a[i] = j;
    }
    for (i = 0; i < (N); i++) {
      for (j = 0; j < (N); j++) {
        if (j > 0) printf(" ");
        if (i == j)
          printf("0");
        else
          printf("%d", a[i] + a[j]);
      }
      printf("\n");
    }
  }
  return 0;
}
