#include <bits/stdc++.h>
const int N = 100010;
const int inf = 0x3f3f3f3f;
using namespace std;
int T[31], a[N];
int main() {
  int n;
  scanf("%d", &n);
  T[0] = 0;
  a[0] = 1;
  for (int k = 1; k <= 20; k++) {
    int ret = T[k - 1] + 1;
    while (1) {
      bool f = 1;
      for (int i = 1; i < k; i++)
        if (a[T[i] + ret]) f = 0;
      if (f) {
        for (int i = 1; i < k; i++) a[T[i] + ret] = 1;
        T[k] = ret;
        break;
      }
      ret++;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) printf("%d ", i == j ? 0 : T[i] + T[j]);
    puts("");
  }
  return 0;
}
