#include <bits/stdc++.h>
using namespace std;
long long adj[10][10];
long long A1[4] = {1, 2, 4, 7};
long long A2[6] = {1, 2, 4, 8, 15, 28};
int main() {
  for (int t = 0; t < 2; t++) {
    long long P = (t == 0) ? 1 : 52 * 12;
    for (int j = 1; j < 5; j++) adj[5 + t][5 + t + j] = P * A1[j - 1];
    int cnt = 0;
    for (int i = 1; i < 5; i++)
      for (int j = i + 1; j < 5; j++)
        adj[5 + t + i][5 + t + j] = P * 12 * A2[cnt++];
  }
  long long Q = 52 * 12 * 52 * 12;
  long long C[5];
  C[0] = 1;
  for (int i = 1; i < 5; i++) C[i] = 6 * C[i - 1];
  for (int i = 0; i < 5; i++)
    for (int j = 0; j < 5; j++) adj[i][5 + j] = Q * (C[i] * i + C[j]);
  for (int i = 0; i < 10; i++) {
    adj[i][i] = 0;
    for (int j = i + 1; j < 10; j++) adj[j][i] = adj[i][j];
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << adj[i][j] << (j == n - 1) ? "\n" : " ";
    cout << "\n";
  }
}
