#include <bits/stdc++.h>
int n, a[25];
bool b[2000];
int main() {
  scanf("%d", &n);
  a[1] = 0, a[2] = 1;
  b[1] = 1;
  for (int i = (int)3, _y = n; i <= _y; i++) {
    for (int j = (int)0, _y = 1000; j <= _y; j++) {
      bool flag = 1;
      a[i] = j;
      for (int k = (int)1, _y = i - 1; k <= _y; k++)
        if (b[a[i] + a[k]]) {
          flag = 0;
          break;
        }
      if (flag) {
        for (int k = (int)1, _y = i - 1; k <= _y; k++) b[a[i] + a[k]] = 1;
        break;
      }
    }
  }
  for (int i = (int)1, _y = n; i <= _y; i++) {
    for (int j = (int)1, _y = n; j <= _y; j++)
      printf("%d ", i != j ? a[i] + a[j] : 0);
    puts("");
  }
}
