#include <bits/stdc++.h>
using namespace std;
inline int getInt() {
  int x;
  scanf("%d", &x);
  return x;
}
template <typename tuple<int, int, int> >
inline istream& operator>>(istream& i, vector<tuple<int, int, int> >& v) {
  for (int j = 0; j < ((int)(v).size()); ++j) i >> v[j];
  return i;
}
template <typename tuple<int, int, int> >
string join(const vector<tuple<int, int, int> >& v) {
  stringstream s;
  for (int i = 0; i < ((int)(v).size()); ++i) s << ' ' << v[i];
  return s.str().substr(1);
}
template <typename tuple<int, int, int> >
inline ostream& operator<<(ostream& o, const vector<tuple<int, int, int> >& v) {
  if ((int)(v).size()) o << join(v);
  return o;
}
template <typename T1, typename T2>
inline istream& operator>>(istream& i, pair<T1, T2>& v) {
  return i >> v.first >> v.second;
}
template <typename T1, typename T2>
inline ostream& operator<<(ostream& o, const pair<T1, T2>& v) {
  return o << v.first << "," << v.second;
}
template <typename tuple<int, int, int> >
inline long long int suma(const vector<tuple<int, int, int> >& a) {
  long long int res(0);
  for (auto&& x : a) res += x;
  return res;
}
const double eps = 1e-10;
const long long int LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MX = 200005;
typedef vector<vector<long long int> > vvl;
int main() {
  int n;
  scanf("%d", &n);
  vvl g(n, vector<long long int>(n));
  long long int d = 1;
  for (int x = 1; x < n; ++x) {
    vector<int> a;
    set<int> s;
    int l = 1;
    for (int m = 0; m < (x + 1); ++m) {
      while (s.count(l)) ++l;
      a.push_back(l);
      s.insert(l);
      for (int i = 0; i < (m); ++i) {
        s.insert(l + a[i]);
        for (int j = 0; j < (m); ++j) s.insert(l + a[i] - a[j]);
      }
    }
    for (int i = 0; i < (x); ++i) g[i][x] = g[x][i] = a[i] * d;
    d *= a.back();
  }
  for (int i = 0; i < (n); ++i) cout << g[i] << endl;
  return 0;
}
