#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = double;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll, ll>;
const ll INF = 1e17;
const ld eps = 1e-10;
const ll MOD = 1e9 + 7;
const double pi = acos(-1.0);
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin >> N;
  vector<vector<ll>> ans(N, vector<ll>(N, 0));
  ll cnt = 0;
  if (N <= 9) {
    for (int y = 0; y < N; y++)
      for (int x = y + 1; x < N; x++) {
        ans[y][x] = 1LL << cnt;
        ans[x][y] = 1LL << cnt;
        cnt++;
      }
  } else {
    random_device seed_gen;
    mt19937 engine(seed_gen());
    vector<P> v;
    for (int y = 0; y < N; y++)
      for (int x = y + 1; x < N; x++) v.push_back(P(y, x));
    shuffle(v.begin(), v.end(), engine);
    for (ll i = 0; i < 36; i++) {
      ans[v[i].first][v[i].second] = 1LL << i;
      ans[v[i].second][v[i].first] = 1LL << i;
    }
    for (int i = 36; i < v.size(); i++) {
      uniform_int_distribution<> rand(0, 1LL << 25LL);
      ll huee = rand(engine);
      ans[v[i].first][v[i].second] = huee;
      ans[v[i].second][v[i].first] = huee;
    }
  }
  for (int y = 0; y < N; y++) {
    for (int x = 0; x < N; x++) {
      cout << ans[y][x];
      if (x == N - 1)
        cout << endl;
      else
        cout << " ";
    }
  }
  return 0;
}
