#include <bits/stdc++.h>
using namespace std;
const int V[] = {0,   1,   3,   16,  23,  28,  42,  76,  82,  86,
                 119, 137, 154, 175, 183, 232, 277, 322, 402, 426};
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      if (j) cout << ' ';
      if (i == j)
        cout << 0;
      else
        cout << V[i] + V[j];
    }
    cout << endl;
  }
  return 0;
}
