#include <bits/stdc++.h>
using namespace std;
long long RAND() {
  long long a = 1;
  while (a < (long long)(1e11)) {
    a *= rand();
  }
  return a % (long long)(1e11) + 1;
}
signed main() {
  long long N, i, j;
  scanf("%lld", &N);
  vector<vector<long long>> w(N, vector<long long>(N, 0));
  for (i = 0; i < N; i++) {
    for (j = i + 1; j < N; j++) {
      w[i][j] = RAND();
      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;
}
