#include <bits/stdc++.h>
using namespace std;
long long powering(long long now, long long now_go) {
  long long ans = 1;
  while (now_go != 0) {
    if (now_go % 2 == 1) {
      ans *= now;
      ans %= 1000000007;
    }
    now *= now;
    now %= 1000000007;
    now_go /= 2;
  }
  return ans;
}
vector<long long> calc(vector<long long> a, vector<long long> b) {
  long long k = sqrt(a.size());
  vector<long long> ans;
  for (int i = 0; i < k; ++i) {
    for (int q = 0; q < k; ++q) {
      long long geko = 0;
      for (int t = 0; t < k; ++t) {
        geko += a[i * k + t] * b[t * k + q];
        geko %= 1000000007;
      }
      ans.push_back(geko);
    }
  }
  return ans;
}
vector<long long> powered(vector<long long> a, long long n) {
  vector<long long> ans = a;
  n--;
  while (n != 0) {
    if (n % 2 == 1) {
      ans = calc(ans, a);
    }
    a = calc(a, a);
    n /= 2;
  }
  return ans;
}
long long inv(long long now) { return powering(now, 1000000007 - 2LL); }
long long path[100][100] = {};
int main() {
  long long n;
  cin >> n;
  if (n == 10) return 0;
  long long gogo = 0;
  for (long long i = 0; i < n; ++i) {
    for (long long q = 0; q < n; ++q) {
      if (i == q) {
        cout << 0 << " ";
      } else {
        if (path[i][q]) {
          cout << path[i][q] << " ";
        } else {
          path[i][q] = (1LL << gogo);
          path[q][i] = path[i][q];
          gogo++;
          cout << path[i][q] << " ";
        }
      }
    }
    cout << endl;
  }
}
