#include <bits/stdc++.h>
using namespace std;
int n, T[20] = {0,  1,  2,   4,   7,   12,  20,  29,  38,  52,
                73, 94, 127, 151, 181, 211, 257, 315, 373, 412};
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) printf("%d ", (T[i] + T[j]) * (i != j));
    puts("");
  }
}
