#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "inline")
using namespace std;
long long read() {
  long long x = 0, f = 0;
  char ch = getchar();
  while (!isdigit(ch)) f |= ch == '-', ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return f ? -x : x;
}
const int N = 100;
int n, m;
long long g[N][N];
long long gg[N][N];
int a[N];
long long rand48() {
  long long a = rand() & 65535, b = rand() & 65535, c = rand() & 65535;
  return (a << 32) ^ (b << 16) ^ c;
}
unordered_map<long long, int> mp;
int p[N];
bool check(int i) {
  for (int j = (1); j <= (i - 1); j++)
    for (int k = (j + 1); k <= (i - 1); k++)
      if (a[j] + a[k] == a[i]) return 0;
  for (int j = (1); j <= (i - 1); j++)
    for (int k = (j + 1); k <= (i - 1); k++)
      for (int t = (1); t <= (i - 1); t++)
        if (a[j] + a[k] == a[t] + a[i]) return 0;
  return 1;
}
int main() {
  n = read();
  a[0] = 0, a[1] = 1;
  for (int i = (2); i <= (n - 1); i++) {
    a[i] = a[i - 1] + 1;
    while (!check(i)) a[i]++;
  }
  long long tmp = 1;
  for (int i = (2); i <= (n); i++) {
    for (int j = (1); j <= (i - 1); j++) gg[i][j] = gg[j][i] = tmp * a[j];
    tmp *= a[i - 1] + a[i - 2] + 1;
  }
  while (1) {
    int flag = 1;
    long long mod = rand48() % 100000000LL + 49900000000LL;
    for (int i = (1); i <= (n); i++)
      for (int j = (1); j <= (n); j++) g[i][j] = gg[i][j] % mod;
    for (int i = (1); i <= (n); i++)
      for (int j = (i + 1); j <= (n); j++)
        if (!g[i][j]) flag = 0;
    if (flag) {
      mp.clear();
      for (int i = (1); i <= (n); i++) p[i] = i;
      do {
        if (p[1] > p[n]) continue;
        long long tot = 0;
        for (int i = (1); i <= (n - 1); i++) tot += g[p[i]][p[i + 1]];
        if (tot > 100000000000LL || mp[tot]) {
          flag = 0;
          break;
        }
        mp[tot]++;
      } while (next_permutation(p + 1, p + n + 1));
    }
    if (flag) {
      for (int i = (1); i <= (n); i++) {
        for (int j = (1); j <= (n); j++) {
          cout << g[i][j] << " ";
        }
        cout << endl;
      }
      break;
    }
  }
  return 0;
}
