#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define ba 47
#define MAXN 100005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
    if(c == '-') f = -1;
    c = getchar();
    }
    while(c >= '0' && c <= '9') {
    res = res * 10 +c - '0';
    c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
    out(x / 10);
    }
    putchar('0' + x % 10);
}

int N,tot;
int64 w[15][15],M,a[] = {0,1,2,4,7,12,20,29,38,53,73};
bool vis[15];
void dfs(int dep,int pre,int64 sum) {
    if(dep > tot) {
        M = max(M,sum);
        return;
    }
    for(int i = 1 ; i <= tot ; ++i) {
        if(!vis[i]) {
            vis[i] = 1;
            dfs(dep + 1,i,sum + w[pre][i]);
            vis[i] = 0;
        }
    }
}
void Solve() {
    read(N);
    M = 0;
    for(int i = 2 ; i <= N ; ++i) {
        for(int j = 1 ; j < i ; ++j) {
            w[i][j] = w[j][i] = (M + 1) * a[j];
        }
        tot = i;
        dfs(1,0,0);
    }
    for(int i = 1 ; i <= N ; ++i) {
        for(int j = 1 ; j <= N ; ++j) {
            out(w[i][j]);space;
        }
        enter;
    }
}
int main(){
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
}
