#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int main() {
  int mark[11111] = {0};
  int a[22] = {1};
  int n;
  for (n = 1; n < 22; n++) {
    int x, i;
    for (x = a[n - 1] + 1;; x++) {
      for (i = 0; i < n && !mark[x + a[i]]; i++)
        ;
      if (i == n) break;
    }
    a[n] = x;
    for (i = 0; i < n; i++) mark[x + a[i]] = 1;
  }
  while (scanf("%d", &n) > 0) {
    int i, j;
    for (i = 0; i < n; i++)
      for (j = 0; j < n; j++) {
        int x = i == j ? 0 : a[i] + a[j];
        printf("%d%c", x, j < n - 1 ? ' ' : '\n');
      }
  }
  return 0;
}
