#include <bits/stdc++.h>
using namespace std;
const long long primelist[9] = {23, 19, 17, 13, 11, 7, 5, 3, 2};
long long a[10][10];
int N;
int main() {
  cin >> N;
  long long s = 1;
  for (int i = 0; i < 9; ++i) {
    s *= primelist[i];
  }
  for (int i = 0; i < N - 1; ++i) {
    long long c = 0;
    while (c % primelist[i] != 1) {
      c += s / primelist[i];
    }
    a[i][i + 1] = a[i + 1][i] = c % s;
    for (int j = i + 2; j < N; ++j) {
      a[i][j] = a[j][i] = (a[i][i + 1] + a[i][j - 1]) % s;
    }
  }
  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;
  }
}
