#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int n; cin >> n;
  auto fn = [&](const auto& fn, int n) -> VV<lint> {
    if (n == 2) {
      return {{0, 1}, {1, 0}};
    }
    auto res = fn(fn, n - 1);
    lint mx = 0;
    {
      V<> vs(n - 1);
      iota(begin(vs), end(vs), 0);
      do {
        lint curr = 0;
        int p = -1;
        for (int v : vs) {
          if (p != -1) curr += res[p][v];
          p = v;
        }
        mx = max(mx, curr);
      } while (next_permutation(begin(vs), end(vs)));
    }
    V<> fib{1, 2, 3, 5, 8, 13, 21, 34, 55};
    V<lint> v;
    for (int i = 0; i < n - 1; ++i) {
      res[i].push_back(fib[i] * (mx + 1));
      v.push_back(res[i].back());
    }
    v.push_back(0);
    res.push_back(v);
    return res;
  };
  for (const auto& v : fn(fn, n)) {
    for (int i = 0; i < n; ++i) {
      cout << v[i] << " \n"[!(n + ~i)];
    }
  }
}