#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
#define ll long long
int n,p[11],a[11]={0,1,2,4,7,12,20,29,38,52,73};
ll g[11][11],M;
int main()
{
    scanf("%d",&n);
    for(int i=2;i<=n;++i)
    {
        for(int j=1;j<i;++j)g[i][j]=g[j][i]=(M+1)*a[j];
        if(i==n)break;
        for(int j=1;j<=i;++j)p[j]=j;
        do
        {
            ll s=0;
            for(int j=1;j<i;++j)s+=g[p[j]][p[j+1]];
            M=max(M,s);
        }while(next_permutation(&p[1],&p[i+1]));
    }
    for(int i=1;i<=n;++i,puts(""))
        for(int j=1;j<=n;++j)
            printf("%lld ",g[i][j]);
    return 0;
}