#include <bits/stdc++.h>
using i64 = long long;

int main() {
    int n;
    std::cin >> n;

    std::vector<i64> a { 1 };
    std::set<i64> s { 1 };
    for (int i = 1; i <= n; i++) {
        i64 x = a.back();
        bool ok = false;
        while (!ok) {
            x++;
            while (s.count(x)) x++;
            ok = true;
            for (int j = 0; j < i; j++) {
                if (s.count(a[j] + x)) {
                    ok = false;
                    break;
                }
            }
        }
        s.insert(x);
        for (int j = 0; j < i; j++) {
            s.insert(a[j] + x);
        }
        a.push_back(x);
    }

    // for (int i = 0; i < a.size(); i++) std::cout << a[i] << std::endl;
    std::vector<std::vector<i64>> ret(n, std::vector<i64>(n));

    i64 m = 0;
    for (int i = 1; i < n; i++) {
        for (int j = 0; j < i; j++) {
            ret[i][j] = ret[j][i] = (m + 1) * a[j];
        }

        std::vector<int> p;
        for (int j = 0; j <= i; j++) p.push_back(j);
        do {
            i64 k = 0;
            for (int j = 0; j < i; j++) k += ret[p[j]][p[j + 1]];
            m = std::max(m, k);
        } while (std::next_permutation(p.begin(), p.end()));
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) std::cout << ret[i][j] << " ";
        std::cout << std::endl;
    }

    return 0;
}
