#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long MOD = 1000000007;
long long INF = 100100100100100;
long long a[50];
long long ans[13][13];
signed main() {
  long long n;
  cin >> n;
  long long ima = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = i; j < n; j++) {
      if (i != j) {
        ans[i][j] = 1LL << ima;
        ans[j][i] = ans[i][j];
        ima++;
      }
    }
  }
  for (long long i = 0; i < (long long)(n); i++) {
    for (long long j = 0; j < (long long)(n); j++) cout << ans[i][j] << " ";
    cout << endl;
  }
  return 0;
}
