#include <bits/stdc++.h>
using namespace std;
namespace _Template_ {
struct cww {
  cww() {
    if (1) {
      ios::sync_with_stdio(false);
      cin.tie(0);
    }
  }
} star;
template <typename T>
inline bool chmin(T& l, T r) {
  bool a = l > r;
  if (a) l = r;
  return a;
}
template <typename T>
inline bool chmax(T& l, T r) {
  bool a = l < r;
  if (a) l = r;
  return a;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& it : v) is >> it;
  return is;
}
class reverse_range {
 private:
  struct I {
    int x;
    int operator*() { return x - 1; }
    bool operator!=(I& lhs) { return x > lhs.x; }
    void operator++() { --x; }
  };
  I i, n;

 public:
  reverse_range(int n) : i({0}), n({n}) {}
  reverse_range(int i, int n) : i({i}), n({n}) {}
  I& begin() { return n; }
  I& end() { return i; }
};
class range {
 private:
  struct I {
    int x;
    int operator*() { return x; }
    bool operator!=(I& lhs) { return x < lhs.x; }
    void operator++() { ++x; }
  };
  I i, n;

 public:
  range(int n) : i({0}), n({n}) {}
  range(int i, int n) : i({i}), n({n}) {}
  I& begin() { return i; }
  I& end() { return n; }
  reverse_range operator!() { return reverse_range(*i, *n); }
};
template <typename T>
inline T& unused_var(T& v) {
  return v;
}
using LL = long long;
}  // namespace _Template_
using namespace _Template_;
namespace xorshift {
unsigned yy = 143132322;
inline unsigned rand() {
  yy = yy ^ (yy << 13);
  yy = yy ^ (yy >> 17);
  return yy = yy ^ (yy << 5);
}
inline unsigned randInt() { return rand(); }
}  // namespace xorshift
LL w[11][11];
unordered_map<LL, int> cnt;
constexpr long long mask = 1 + (LL)(1e10);
int main() {
  int N;
  cin >> N;
  for (int i : range(N)) {
    for (int j : range(i)) {
      w[i][j] = w[j][i] =
          abs(xorshift::randInt() * 1ll * xorshift::randInt() % mask);
    }
  }
  vector<int> o(N);
  iota((o).begin(), (o).end(), 0);
  int ans = 0;
  int c = 0;
  do {
    int k = 0;
    for (int i : range(N - 1)) {
      k += w[o[i]][o[i + 1]];
    }
    cnt[k]++;
    chmax(ans, cnt[k]);
    if (cnt[k] > 2) c++;
  } while (next_permutation((o).begin(), (o).end()));
  for (int i : range(N)) {
    for (int j : range(N)) {
      cout << w[i][j] << " ";
    }
    cout << endl;
  }
  cerr << ans << endl;
  cerr << c << endl;
  return 0;
}
