#include <bits/stdc++.h>
int a[21][21], i, j, o, w[9999], c, n;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    for (c = 1;; c++) {
      o = 1;
      for (j = 1; j < i; j++) {
        if (w[a[1][j] + c]) {
          o = 0;
          break;
        }
      }
      if (o) break;
    }
    for (j = 1; j < i; j++) {
      a[i][j] = a[j][i] = a[1][j] + c;
      w[a[i][j]] = 1;
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) printf("%d ", a[i][j]);
    printf("\n");
  }
}
