#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  if (N == 2) {
    printf("0 4200782951\n4200782951 0\n");
  } else if (N == 3) {
    printf(
        "0 595392113 3485670742\n595392113 0 3993409801\n3485670742 3993409801 "
        "0\n");
  } else if (N == 4) {
    printf("0 111 157 193\n111 0 224 239\n157 224 0 258\n193 239 258 0");
  }
}
