#include <bits/stdc++.h>
using namespace std;
bool problema(int next, set<int> &aparecidos, vector<int> &v) {
  for (int i = 0; i < int(v.size()); i++)
    if (aparecidos.find(next + v[i]) != aparecidos.end()) return true;
  return false;
}
int main() {
  int n;
  cin >> n;
  vector<int> v;
  v.push_back(1);
  set<int> aparecidos;
  for (int i = 1; i < n; i++) {
    int ultimo = v[int(v.size()) - 1];
    int next = ultimo + 1;
    while (problema(next, aparecidos, v)) next++;
    for (int j = 0; j < int(v.size()); j++) aparecidos.insert(v[j] + next);
    v.push_back(next);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j > 0) cout << " ";
      if (i == j)
        cout << 0;
      else
        cout << v[i] + v[j];
    }
    cout << endl;
  }
}
