#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int i = 1;
  vector<int> T;
  while ((int)(T).size() < 20) {
    bool good = true;
    for (int a : T)
      for (int b : T)
        for (int c : T)
          if (a != b && b != c && c != a && i == a + b - c) good = false;
    if (good) T.push_back(i);
    i++;
  }
  int n;
  cin >> n;
  for (int i = (0); i <= (n - 1); ++i) {
    for (int j = (0); j <= (n - 1); ++j) {
      if (i == j)
        cout << 0;
      else
        cout << T[i] + T[j];
      cout << ' ';
    }
    cout << '\n';
  }
  return 0;
}
