#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void amin(T &x, const T &y) {
  if (y < x) x = y;
}
template <class T>
inline void amax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class Iter>
void rprintf(const char *fmt, Iter begin, Iter end) {
  for (bool sp = 0; begin != end; ++begin) {
    if (sp)
      putchar(' ');
    else
      sp = true;
    printf(fmt, *begin);
  }
  putchar('\n');
}
int N;
long long W[12][12];
bool use[1011];
void MAIN() {
  vector<int> v;
  use[0] = true;
  int ma = 0;
  for (int i = 0, i_len = (1011); i < i_len; ++i)
    if (!use[i] && i > ma) {
      for (__typeof((v).begin()) e = (v).begin(), e_end = (v).end(); e != e_end;
           ++e)
        if (i + *e < 1011) {
          use[i + *e] = true;
          amax(ma, i + *e);
        }
      v.push_back(i);
      amax(ma, i);
    }
  scanf("%d", &N);
  W[0][1] = W[1][0] = 1;
  for (int s = 2; s < N; s++) {
    for (int i = 0, i_len = (s); i < i_len; ++i)
      for (int j = 0, j_len = (s); j < j_len; ++j) W[i][j] *= v[s - 1] + 1;
    for (int i = 0, i_len = (s); i < i_len; ++i) W[i][s] = W[s][i] = v[i];
  }
  for (int i = 0, i_len = (N); i < i_len; ++i) rprintf("%lld", W[i], W[i] + N);
}
int main() {
  int TC = 1;
  for (int tc = 0, tc_len = (TC); tc < tc_len; ++tc) MAIN();
  return 0;
}
