#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<vector<ll> > ans(n, vector<ll>(n, 0));
  int cnt = 0;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (cnt <= 36) {
        ans[i][j] = ans[j][i] = (1LL << cnt);
        cnt++;
      } else {
        v.emplace_back(i, j);
      }
    }
  }
  mt19937 mt(0);
  uniform_int_distribution<ll> rnd(1, 100000000000LL);
  for (int i = 0; i < v.size(); i++) {
    ans[v[i].first][v[i].second] = ans[v[i].second][v[i].first] = rnd(mt);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << ans[i][j] << " \n"[j + 1 == n];
    }
  }
  return 0;
}
