#include <bits/stdc++.h>
using namespace std;
const int mn = 100;
int a[mn], n, i, j, k;
bool b[2100];
int main() {
  scanf("%d", &n);
  k = 0;
  for (i = 0; i <= 1000; ++i) {
    for (j = 1; j <= k; ++j)
      if (b[i + a[j]]) break;
    if (b[i + a[j]]) continue;
    for (j = 1; j <= k; ++j) b[i + a[j]] = 1;
    a[++k] = i;
    if (k == n) break;
  }
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= n - 1; ++j) printf("%d ", i == j ? 0 : a[i] + a[j]);
    printf("%d\n", i == n ? 0 : a[i] + a[n]);
  }
  return 0;
}
