#include <bits/stdc++.h>
using namespace std;
bool ok[1011];
int a[100];
int main() {
  for (int i = (1); i <= (20); i++) {
    a[i] = 0;
    while (ok[a[i]]) a[i]++;
    for (int j = (1); j <= (i); j++)
      for (int k = (1); k <= (i); k++)
        for (int h = (1); h <= (i); h++) {
          if (j == k && j != h) continue;
          ok[max(0, a[j] + a[k] - a[h])] = 1;
        }
  }
  int n;
  cin >> n;
  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]);
    }
    printf("\n");
  }
  return 0;
}
