#include <bits/stdc++.h>
int a[21] = {1,   2,   3,   6,   12,  19,  27,  39,  58,  80,
             103, 131, 145, 174, 214, 244, 294, 352, 384, 418},
    n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i, printf("\n"))
    for (int j = 0; j < n; ++j) printf("%d ", (i == j ? 0 : a[i] + a[j]));
}
