#include <bits/stdc++.h>
using namespace std;
using li = long long;
using ld = long double;
void solve(bool);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(20);
  solve(true);
  return 0;
}
int n;
li g[11][11];
void solve(bool __attribute__((unused)) read) {
  srand(226);
  cin >> n;
  int cnt = 0;
  memset(g, 0, sizeof g);
  for (int i = 0; i < min(n, 9); ++i) {
    for (int j = 0; j < min(n, 9); ++j) {
      if (i == j) continue;
      if (g[j][i])
        g[i][j] = g[j][i];
      else
        g[i][j] = (1ll << (cnt++));
    }
  }
  if (n == 10) {
    for (int i = 0; i < 9; ++i) {
      int j = rand() % 8;
      if (j >= i) ++j;
      g[9][i] = g[i][9] = g[i][j];
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cout << g[i][j] << " ";
    }
    cout << "\n";
  }
}
