#include <bits/stdc++.h>
using namespace std;
template <class T>
T inf() {
  return numeric_limits<T>::has_infinity ? numeric_limits<T>::infinity()
                                         : (numeric_limits<T>::max() / 2);
}
int N;
const int B = 15;
long long f[B];
long long dist[10][10];
void check() {
  unordered_map<long long, int> s;
  vector<int> a(N);
  for (int i = 0; i < (int)(N); ++i)
    for (int j = 0; j < (int)(N); ++j) assert(dist[i][j] <= 1e+11);
  for (int i = 0; i < (int)(N); ++i) a[i] = i;
  do {
    long long sum = 0;
    for (int i = 0; i < (int)(N - 1); ++i) {
      sum += dist[a[i]][a[i + 1]];
    }
    s[sum]++;
    assert(s[sum] <= 2);
  } while (next_permutation((a).begin(), (a).end()));
}
void solve() {
  f[0] = 1;
  f[1] = 2;
  for (int i = 2; i < B; i++) f[i] = f[i - 1] + f[i - 2] + 1;
  long long S = 2;
  dist[0][1] = 1;
  for (int i = 2; i < N; i++) {
    for (int j = 0; j < i; j++) {
      dist[j][i] = dist[i][j] = S * f[j];
    }
    S *= f[i] - 1;
  }
  for (int i = 0; i < (int)(N); ++i) {
    for (int j = 0; j < (int)(N); ++j) {
      if (i < j)
        cout << dist[i][j] << " ";
      else if (i > j)
        cout << dist[j][i] << " ";
      else
        cout << 0 << " ";
    }
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> N;
  solve();
  return 0;
}
