#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  long N;
  scanf("%ld", &N);
  vector<vector<long>> wss(N, vector<long>(N, 0));
  for (long i = 1; i < N; i++) {
    wss[0][i] = 1;
    wss[i][0] = 1;
  }
  long k = 1;
  for (long i = 1; i < N; i++) {
    for (long j = i + 1; j < N; j++) {
      const long w = 1L << k;
      wss[i][j] = w;
      wss[j][i] = w;
      k++;
    }
  }
  for (long i = 0; i < N; i++) {
    for (long j = 0; j < N; j++) {
      printf("%ld ", wss[i][j]);
    }
    printf("\n");
  }
  return 0;
}
