#include <bits/stdc++.h>
using namespace std;
long long int ds[15][15] = {};
int main(void) {
  long long int b = 1;
  for (int i = ((int)(1)); i <= ((int)(9)); i++) {
    ds[i][i] = 0;
    for (int j = 0; j < ((int)(i)); j++) {
      long long int d = ((i + j) % 11 + 1) * b;
      ds[i][j] += d;
      ds[j][i] += d;
    }
    b *= 12;
  }
  int n;
  scanf("%d", &n);
  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;
}
