#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<bool> vis(1001);
  int A[n];
  A[0] = 1;
  vis[1] = true;
  int j = 1;
  int x = 2;
  while (j < n) {
    for (int ctr = x; ctr < 1001; ctr++) {
      bool fl = true;
      for (int i = 0; i < j; i++) {
        if (vis[ctr + A[i]]) fl = false;
      }
      if (fl) {
        for (int i = 0; i < j; i++) {
          vis[ctr + A[i]] = true;
        }
        A[j] = ctr;
        j++;
        break;
      }
    }
  }
  int B[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      if (j == i)
        B[i][j] = 0;
      else
        B[i][j] = B[j][i] = A[i] + A[j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) printf("%d ", B[i][j]);
    puts("");
  }
  return 0;
}
