#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  ll dist[n][n];
  ll cnt = 0;
  for (int i = (int)(0); i < (int)(n); ++i)
    for (int j = (int)(0); j < (int)(i + 1); ++j) {
      if (i == j)
        dist[i][j] = 0;
      else {
        dist[i][j] = dist[j][i] = 1ll << cnt;
        ++cnt;
      }
    }
  for (int i = (int)(0); i < (int)(n); ++i) {
    for (int j = (int)(0); j < (int)(n); ++j) cout << dist[i][j] << " ";
    cout << endl;
  }
  return 0;
}
