#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
ll adj[10][10];

ll A1[4] = {1, 2, 4, 7};
ll A2[6] = {1, 2, 4, 8, 15, 28};

int main() {
    for (int t = 0; t < 2; t++) {
        ll 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++];
    }
    ll Q = 52 * 12 * 52 * 12;

    ll 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][j] = 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";
}

}
