#include <bits/stdc++.h>
using namespace std;
long long g[15][15], ans;
int i, j, vis[15], n;
void dfs(int l, int i, int n, long long s) {
  int j;
  if (i > n) {
    ans = max(ans, s);
    return;
  }
  for (j = 1; j <= n; ++j)
    if (vis[j] == 0) {
      vis[j] = 1;
      dfs(j, i + 1, n, s + g[l][j]);
      vis[j] = 0;
    }
}
int main() {
  scanf("%d", &n);
  for (i = 2; i <= n; ++i) {
    dfs(0, 1, i, 0);
    for (j = 1; j < i; ++j) g[j][i] = g[i][j] = ans * j + 1;
  }
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= n; ++j) cout << g[i][j] << ' ';
    cout << endl;
  }
}
