#include <bits/stdc++.h>
using namespace std;
const long long x[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 = 1; i < N; ++i) {
    for (int j = 0; j < i; ++j) {
      a[i][j] = a[j][i] = b * x[j];
    }
    b *= x[i];
  }
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      if (i != j) {
        a[i][j] = a[i][j] / 2 + 1;
      }
      cout << a[i][j];
      if (j != N - 1) cout << ' ';
    }
    cout << endl;
  }
}
