#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 = 15;
int n, m;
long long g[N][N];
int a[N] = {0, 1, 2, 4, 7, 10, 13, 16, 19, 22, 25};
int main() {
  n = read();
  long long tmp = 1;
  for (int i = (2); i <= (n); i++) {
    for (int j = (1); j <= (i - 1); j++) g[i][j] = g[j][i] = tmp * a[j];
    tmp *= a[i - 1] + 1;
  }
  for (int i = (1); i <= (n); i++) {
    for (int j = (1); j <= (n); j++) {
      cout << g[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
