#include <bits/stdc++.h>
using namespace std;
const int N = 10;
int a[N - 1] = {1, 2, 3, 5, 8, 13, 21, 30, 39};
long long w[N][N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  long long mx = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      w[j][i] = w[i][j] = (mx + 1) * a[j];
    }
    int b[10];
    for (int j = 0; j <= i; j++) {
      b[j] = j;
    }
    do {
      long long cur = 0;
      for (int j = 0; j < i; j++) {
        cur += w[b[j]][b[j + 1]];
      }
      mx = max(mx, cur);
    } while (next_permutation(b, b + i + 1));
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << w[i][j] << " ";
    }
    cout << "\n";
  }
  return 0;
}
