#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;
  a[0][1] = a[1][0] = 1;
  a[0][2] = a[2][0] = 1;
  for (int i = 3; i < N; ++i) {
    a[0][i] = a[i][0] = x[i - 3] + 1;
  }
  b = 54;
  for (int i = 1; i < N; ++i) {
    for (int j = i + 1; j < N; ++j) {
      a[i][j] = a[j][i] = x[j - i - 1] * b + 1;
    }
    b *= x[9 - i];
  }
  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;
  }
}
