#include <bits/stdc++.h>
using namespace std;
long long int ds[15][15];
int main(void) {
  int n;
  scanf("%d", &n);
  long long int b = 2;
  for (int i = 0; i < ((int)(n)); i++) {
    ds[i][0] = ds[0][i] = 1;
    ds[i][i] = 0;
    for (int j = ((int)(1)); j <= ((int)(i - 1)); j++) {
      ds[i][j] = ds[j][i] = b;
      b *= 2;
    }
  }
  for (int i = 0; i < ((int)(n)); i++)
    for (int j = 0; j < ((int)(n)); j++) {
      printf("%lld%c", ds[i][j], j + 1 == n ? '\n' : ' ');
    }
  return 0;
}
