#include <bits/stdc++.h>
int a[1000];
int main() {
  int n;
  scanf("%d", &n);
  a[0] = 1;
  a[0] = 2;
  for (int i = 2; i < n; i++)
    for (int j = 1; j < 1000; j++) {
      bool flag = true;
      for (int k = 0; k < i; k++)
        for (int l = k + 1; l < i; l++)
          for (int m = 0; m < i; m++)
            if (a[k] + a[l] == j + a[m]) flag = false;
      if (flag) {
        a[i] = j;
        break;
      }
    }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) printf("%d ", (i == j) ? 0 : (a[i] + a[j]));
    printf("\n");
  }
  return 0;
}
