#include <bits/stdc++.h>
using namespace std;
long long RAND() {
  long long a = 1;
  while (a < ((long long)(1e11) - 3)) {
    a *= rand();
  }
  return a % ((long long)(1e11) - 3) + 1;
}
long long cmp(long long a) {
  if (a <= ((long long)(1e11) - 3))
    return a;
  else
    return rand();
}
signed main() {
  long long N, i, j;
  scanf("%lld", &N);
  vector<vector<long long>> w(N, vector<long long>(N, 0));
  vector<long long> v(N, 0);
  while (1) {
    for (i = 0; i < N; i++) {
      v[i] = RAND();
    }
    long long k = 0;
    for (i = 0; i < N; i++) {
      for (j = i + 1; j < N; j++) {
        w[i][j] = cmp(1ll << k);
        k++;
        w[j][i] = w[i][j];
      }
    }
    for (i = 0; i < N; i++) {
      for (j = 0; j < N; j++) {
        printf("%lld ", w[i][j]);
      }
      printf("\n");
    }
    return 0;
  }
}
