#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int a[12];
  a[0] = 1, a[1] = 2;
  set<long long int> st;
  st.insert(1);
  st.insert(2);
  st.insert(3);
  for (int i = 2; i <= n; i++) {
    for (a[i] = a[i - 1] + 1;; a[i]++) {
      bool ok = 1;
      for (int j = 0; j < i; j++) {
        if (st.find(a[j] + a[i]) != st.end()) {
          ok = 0;
          break;
        }
      }
      if (ok) {
        st.insert(a[i]);
        for (int j = 0; j < i; j++) st.insert(a[j] + a[i]);
        break;
      }
    }
  }
  long long int w[12][12] = {};
  w[0][1] = w[1][0] = 1, w[0][2] = w[2][0] = 2, w[1][2] = w[2][1] = 3;
  long long int m = 5;
  for (int i = 3; i < n; i++) {
    for (int j = 0; j < i; j++) w[j][i] = w[i][j] = (m + 1) * a[j];
    vector<int> v(12);
    for (int j = 0; j <= i; j++) v[j] = j;
    while (1) {
      long long int s = 0;
      for (int j = 0; j < i; j++) {
        s += w[v[j]][v[j + 1]];
      }
      m = max(m, s);
      if (!next_permutation(v.begin(), v.end())) break;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << w[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
