#include <bits/stdc++.h>
using namespace std;
const int N = 10;
long long w[N][N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  mt19937 rnd(228);
  int n;
  cin >> n;
  if (n < 10) {
    for (int x = 0, j = 0; x < n; x++) {
      for (int y = x + 1; y < n; y++) {
        w[y][x] = w[x][y] = (1ll << j);
        j++;
      }
    }
  } else {
    for (int x = 0, j = 0; x < n - 1; x++) {
      for (int y = x + 1; y < n - 1; y++) {
        w[y][x] = w[x][y] = (1ll << j);
        j++;
      }
    }
    for (int i = 0; i < n - 1; i++) {
      if (i != n - 1) w[n - 1][i] = w[i][n - 1] = (1ll << 35) + rnd();
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << w[i][j] << " ";
    }
    cout << "\n";
  }
  return 0;
}
