#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  ll dist[n][n];
  ll cnt = 0;
  if (n <= 9) {
    for (int i = (int)(0); i < (int)(n); ++i)
      for (int j = (int)(0); j < (int)(i + 1); ++j) {
        if (i == j)
          dist[i][j] = 0;
        else {
          dist[i][j] = dist[j][i] = 1ll << cnt;
          ++cnt;
        }
      }
  } else {
    for (int i = (int)(0); i < (int)(9); ++i)
      for (int j = (int)(0); j < (int)(i + 1); ++j) {
        if (i == j)
          dist[i][j] = 0;
        else {
          dist[i][j] = dist[j][i] = 1ll << cnt;
          ++cnt;
        }
        dist[0][9] = dist[9][0] = 143664541;
        dist[1][9] = dist[9][1] = 143662486;
        dist[2][9] = dist[9][2] = 143625105;
        dist[3][9] = dist[9][3] = 143137016;
        dist[4][9] = dist[9][4] = 143235760;
        dist[5][9] = dist[9][5] = 140245268;
        dist[6][9] = dist[9][6] = 172204886;
        dist[7][9] = dist[9][7] = 307402921;
        dist[8][9] = dist[9][8] = 240750174;
        dist[9][9] = 0;
      }
  }
  for (int i = (int)(0); i < (int)(n); ++i) {
    for (int j = (int)(0); j < (int)(n); ++j) cout << dist[i][j] << " ";
    cout << endl;
  }
  return 0;
}
