#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (int i = (0); i < (v.size()); i++) os << v[i] << " ";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v) {
  for (typename set<T>::iterator it = v.begin(); it != v.end(); it++)
    os << *it << " ";
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& v) {
  os << v.first << " " << v.second << endl;
  return os;
}
const int maxn = 11;
long long num = 1;
long long bef = 0;
int n;
long long ans[maxn][maxn];
int main() {
  scanf("%d", &n);
  for (int line = (0); line < (n); line++) {
    for (int row = 0; row < line; row++) {
      ans[row][line] = num;
      long long temp = num;
      num = temp + bef + 1;
      bef = temp;
    }
  }
  for (int i = (0); i < (n); i++) {
    for (int j = 0; j < i; j++) {
      ans[i][j] = ans[j][i];
    }
  }
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (n); j++) {
      if (j) printf(" ");
      printf("%lld", ans[i][j]);
    }
    printf("\n");
  }
  return 0;
}
