#include <bits/stdc++.h>
using namespace std;
long long moddiv(long long a, long long b) {
  a %= ((long long)1e9 + 7);
  b %= ((long long)1e9 + 7);
  for (long long m = ((long long)1e9 + 7) - 2; m > 0; m /= 2) {
    if (m & 1) {
      a = a * b % ((long long)1e9 + 7);
    }
    b = b * b % ((long long)1e9 + 7);
  }
  return a;
}
long long N, H, D;
long long i, j, k;
long long ans[20][20];
int main() {
  scanf("%lld", &N);
  for (i = 1; i < N; i++) {
    ans[i][0] = ans[0][i] = 9 * (1ll << i);
  }
  for (i = 1; i < N; i++) {
    for (j = i + 1; j < N; j++) {
      ans[j][i] = ans[i][j] = 1;
    }
  }
  for (i = 0; i < N; i++) {
    for (j = 0; j < N; j++) {
      printf("%lld ", ans[i][j]);
    }
    printf("\n");
  }
  return 0;
}
