#include <bits/stdc++.h>
using namespace std;
int A[9] = {1, 2, 4, 7, 12, 20, 29, 38, 52};
long long arr[11][11], N;
int main() {
  cin >> N;
  long long MX = 1;
  for (int i = 2; i <= N; ++i) {
    for (int j = 1; j < i; ++j) arr[i][j] = arr[j][i] = MX * A[j - 1];
    MX += arr[i][i - 1] + arr[i][i - 2] - arr[i - 1][i - 2];
  }
  for (int i = 1; i <= N; ++i)
    for (int j = 1; j <= N; ++j) cout << arr[i][j] << " \n"[j == N];
  return 0;
}
