#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int d[12][12] = {};
  d[0][1] = d[1][0] = 1;
  for (int i = 2; i < n; i++) d[0][i] = d[0][i - 1] * 3, d[i][0] = d[0][i];
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      d[i][j] = d[0][i] + d[0][j];
      d[j][i] = d[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << d[i][j];
      if (j < n - 1) cout << " ";
    }
    cout << endl;
  }
  return 0;
}
