#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  long long w[100][100] = {};
  for (int i = 0; i < N; i++) {
    w[i][i] = 0;
  }
  long long f1 = 1;
  long long f2 = 0;
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      w[i][j] = f1 + f2;
      w[j][i] = f2 + f1;
      long long temp = f1 + f2;
      f2 = f1;
      f1 = temp;
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      cout << w[i][j];
      if (j != N - 1) {
        cout << " ";
      } else {
        cout << endl;
      }
    }
  }
  return 0;
}
