#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int a[21];
  a[1] = 0;
  set<int> s;
  for (int i = 2; i <= 20; ++i) {
    for (int x = 1;; ++x) {
      bool ok = true;
      for (int j = 1; j < i; ++j) {
        if (s.count(a[j] + x)) {
          ok = false;
        }
      }
      if (ok) {
        a[i] = x;
        for (int j = 1; j < i; ++j) {
          s.insert(a[j] + a[i]);
        }
        break;
      }
    }
  }
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (i == j) {
        cout << "0 ";
      } else {
        cout << a[i] + a[j] << " ";
      }
    }
    cout << "\n";
  }
}
