#include <bits/stdc++.h>
using namespace std;
int D[30] = {0,   2,   3,   4,   8,   13,  20,  27,  41,  56,  71,
             101, 132, 158, 193, 215, 265, 297, 329, 375, 437, 496};
int b[21];
int vis[2000];
int main() {
  memset(b, -1, sizeof(b));
  b[0] = 1;
  b[1] = 2;
  b[2] = 3;
  for (int i = 3; i < 20; i++) {
    memset(vis, 0, sizeof(vis));
    for (int j = 0; j < i; j++) {
      vis[b[j]] = 1;
      for (int k = 0; k < j; k++) {
        for (int j1 = 0; j1 < k; j1++) {
          vis[b[j] + b[k] - b[j1]] = 1;
        }
      }
    }
    for (int k = 1; k <= 1000; k++) {
      if (!vis[k]) {
        b[i] = k;
        break;
      }
    }
  }
  int n;
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        printf("%d", (i == j) ? 0 : b[i] + b[j]);
        if (j == n - 1)
          printf("\n");
        else
          printf(" ");
      }
    }
  }
  return 0;
}
