#include <bits/stdc++.h>
using namespace std;
int N;
signed long long W[10][10];
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  W[1][0] = W[0][1] = 1;
  for (N = 3; N <= 10; N++) {
    vector<int> V;
    for (i = 0; i < (N - 1); i++) V.push_back(i);
    set<signed long long> C;
    do {
      if (V[0] > V.back()) continue;
      signed long long ret = 0;
      for (i = 0; i < (N - 2); i++) ret += W[V[i]][V[i + 1]];
      C.insert(ret);
    } while (next_permutation((V.begin()), (V.end())));
    signed long long M = *C.rbegin();
    int cand[] = {1, 2, 4, 7, 12, 20, 29, 38, 52, 73};
    for (x = 0; x < (N - 1); x++) {
      W[N - 1][x] = W[x][N - 1] = cand[x] * M;
    }
  }
  cin >> N;
  vector<int> V;
  for (i = 0; i < (N); i++) V.push_back(i);
  set<signed long long> C;
  do {
    if (V[0] > V.back()) continue;
    signed long long ret = 0;
    for (i = 0; i < (N - 1); i++) ret += W[V[i]][V[i + 1]];
    assert(C.count(ret) == 0);
  } while (next_permutation((V.begin()), (V.end())));
  for (y = 0; y < (N); y++) {
    for (x = 0; x < (N); x++) cout << W[y][x] << " ";
    cout << endl;
  }
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}
