#include <bits/stdc++.h>
using namespace std;
long long a1[13] = {1, 2, 4, 7, 12, 20, 33, 54, 88, 143};
long long n, an[15][15], no = 1;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) an[i][i] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) an[i][j] = an[j][i] = no * a1[j - i - 1];
    no *= a1[n - i];
  }
  if (n == 10) {
    an[8][10] = an[10][8] = 30000000000;
    an[8][9] = an[9][8] = 250000000000;
    an[9][10] = an[10][9] = 40000000000;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << an[i][j] << ' ';
    cout << endl;
  }
  return 0;
}
