#include <bits/stdc++.h>
using namespace std;
const long long t[10] = {1, 2, 4, 7, 12, 20, 33, 54, 88, 143};
int N;
long long a[10][10], b;
int main() {
  cin >> N;
  b = 1;
  for (int i = 0; i < N; ++i) {
    for (int j = i + 1; j < N; ++j) {
      a[i][j] = a[j][i] = b * t[j - i - 1];
    }
    b *= t[9 - i] - 1;
  }
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      cout << a[i][j];
      if (j != N - 1) cout << ' ';
    }
    cout << endl;
  }
}
