#include <bits/stdc++.h>
using namespace std;
const int N = 11;
int n, p[N];
long long a[N][N];
map<long long, int> M;
map<long long, int>::iterator it;
int chk() {
  int i;
  long long x;
  for (i = 1; i <= n; i = i + 1) p[i] = i;
  do {
    x = a[p[1]][p[n]];
    for (i = 1; i < n; i = i + 1) x += a[p[i]][p[i + 1]];
    M[x]++;
  } while (next_permutation(p + 1, p + n + 1));
  for (it = M.begin(); it != M.end(); it++)
    if ((*it).second != 2 * n) return 0;
  return 1;
}
int main() {
  int i, j;
  long long o;
  cin >> n;
  o = 1;
  for (i = 2; i <= n; i = i + 1) {
    a[1][i] = 1, a[i][1] = 1;
    for (j = i + 1; j <= n; j = j + 1)
      a[i][j] = o + 1, a[j][i] = o + 1, o <<= 1;
  }
  for (i = 1; i <= n; i = i + 1) {
    for (j = 1; j <= n; j = j + 1) cout << a[i][j] << ' ';
    cout << endl;
  }
  return 0;
}
