#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> A(n);
  set<int> S;
  for (int i = 2; i <= 500; i++) S.insert(i);
  A[0] = 0;
  A[1] = 1;
  for (int i = 2; i < n; i++) {
    A[i] = *S.begin();
    S.erase(S.begin());
    for (int j = 0; j < i; j++)
      for (int k = j + 1; k < i; k++)
        S.erase(A[i] + A[j] - A[k]), S.erase(A[i] - A[j] + A[k]),
            S.erase(-A[i] + A[j] + A[k]);
  }
  for (int i = 0; i < n; i++, puts(""))
    for (int j = 0; j < n; j++) printf("%d ", (i == j) ? (0) : (A[i] + A[j]));
  return (0);
}
