#include <bits/stdc++.h>
int a[20];
bool flag[4000];
int main() {
  int n;
  scanf("%d", &n);
  a[0] = 0;
  a[1] = 2;
  flag[1] = 1;
  for (int i = 2; i < n; i++)
    for (int j = 0; j <= 2000; j++) {
      bool index = 1;
      for (int k = 0; k < i && index; k++)
        if (flag[(a[k] + j) / 2]) index = 0;
      if (index) {
        a[i] = j;
        for (int k = 0; k < i; k++) flag[(a[k] + j) / 2] = 1;
        break;
      }
    }
  for (int i = 0; i < n; i++, puts(""))
    for (int j = 0; j < n; j++)
      if (i == j)
        printf("0 ");
      else
        printf("%d ", (a[i] + a[j]) / 2);
  return 0;
}
