#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;
ll mpow(ll a, ll b) {
  ll res = 1;
  for (ll((i)) = (0); ((i)) < ((b)); ((i))++) res *= a;
  return res;
}
int main() {
  ll N;
  cin >> N;
  vector<vector<ll>> way(N, vector<ll>(N));
  int cnt = 0;
  for (ll((h)) = (0); ((h)) < ((N)); ((h))++) {
    for (ll((w)) = (0); ((w)) < ((N)); ((w))++) {
      if (w > 0) cout << " ";
      if (h > w) {
        cout << way[w][h];
      } else {
        way[h][w] = mpow(2, cnt);
        cout << way[h][w];
        cnt++;
      }
    }
    cout << endl;
  }
  return 0;
}
