#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,O3,inline")
#pragma GCC target("avx,avx2")
using namespace std;
template <class t>
inline void read(t &s) {
  s = 0;
  register long long f = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  s *= f;
  return;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0) putchar('-'), x = -x;
  long long buf[21], top = 0;
  while (x) buf[++top] = x % 10, x /= 10;
  if (!top) buf[++top] = 0;
  while (top) putchar(buf[top--] ^ '0');
  return;
}
inline void setIn(string s) {
  freopen(s.c_str(), "r", stdin);
  return;
}
inline void setOut(string s) {
  freopen(s.c_str(), "w", stdout);
  return;
}
inline void setIO(string s = "") {
  setIn(s + ".in");
  setOut(s + ".out");
  return;
}
template <class t>
inline bool checkmin(t &x, t y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
template <class t>
inline bool checkmax(t &x, t y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
inline long long lowbit(long long x) { return x & (-x); }
long long f[15];
long long w[150][150];
inline void Init() {
  map<long long, long long> dr;
  dr[3];
  f[1] = 1, f[2] = 2;
  for (long long i = 3; i <= 11; ++i) {
    for (long long j = dr[i - 1] + 1;; ++j) {
      if (dr.count(j)) continue;
      register bool flg = true;
      for (long long k = 1; k < i; ++k)
        if (dr.count(j + f[k])) {
          flg = false;
          break;
        }
      if (!flg) continue;
      f[i] = j;
      for (long long k = 1; k < i; ++k) dr[j + f[k]];
      break;
    }
  }
  return;
}
long long idx[15];
signed main(void) {
  Init();
  long long n;
  read(n);
  for (long long i = 2; i <= n; ++i) {
    register long long maxi = 0;
    for (long long j = 1; j < i; ++j) idx[i] = i;
    do {
      register long long sum = 0;
      for (long long j = 1; j < i - 1; ++j) sum += w[idx[j]][idx[j + 1]];
      checkmax(maxi, sum);
    } while (next_permutation(idx + 1, idx + i));
    for (long long j = 1; j < i; ++j) w[i][j] = w[j][i] = maxi + f[j];
  }
  for (long long i = 1; i <= n; ++i, puts(""))
    for (long long j = 1; j <= n; ++j) write(w[i][j]), putchar(32);
  return 0;
}
