#include <bits/stdc++.h>
using namespace std;
int n;
int a[30];
bool chk[10000];
int main() {
  scanf("%d", &n);
  memset(chk, 0, sizeof(chk));
  a[0] = 1;
  for (int i = 1; i <= n; ++i) {
    a[i] = a[i - 1] + 1;
    for (bool flag = false; !flag; ++a[i]) {
      flag = true;
      for (int j = 1; j < i; ++j)
        if (chk[a[j] + a[i]]) {
          flag = false;
          break;
        }
    }
    --a[i];
    for (int j = 1; j < i; ++j) chk[a[j] + a[i]] = true;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j < n; ++j)
      if (i == j)
        printf("0 ");
      else
        printf("%d ", a[i] + a[j]);
    if (i == n)
      printf("0\n");
    else
      printf("%d\n", a[i] + a[n]);
  }
  return 0;
}
