#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define all(aaa) aaa.begin(), aaa.end()

const int N = 10;
int a[N - 1] = {1, 2, 4, 7, 12, 20, 29, 38, 52};
ll w[N][N];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;

    ll mx = 0;

    for (int i = 1; i < n; i++) {
        for (int j = 0; j < i; j++) {
            w[j][i] = w[i][j] = (mx + 1) * a[j];
        }
        int b[10];
        for (int j = 0; j <= i; j++) {
            b[j] = j;
        }
        do {
            ll cur = 0;
            for (int j = 0; j < i; j++) {
                cur += w[b[j]][b[j + 1]];
            }
            mx = max(mx, cur);
        } while (next_permutation(b, b + i + 1));
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cout << w[i][j] << " ";
        }
        cout << "\n";
    }

    return 0;
}