#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
using namespace std;
typedef long long ll;

const int N=12,c[11]={0,1,2,4,7,12,20,29,38,52,73};
ll w[N][N],p[N],n,M;

int main(){
	cin>>n;
	rep(i,2,n){
		rep(j,1,i-1) w[i][j]=w[j][i]=(M+1)*c[j];
		if(i==n) break;
		rep(j,1,i) p[j]=j;
		do{
			if(p[1]>p[i]) continue;
			ll sum=0;
			rep(j,1,i-1) sum+=w[p[j]][p[j+1]];
			M=max(M,sum);
		}while(next_permutation(p+1,p+i+1));
	}
	rep(i,1,n) rep(j,1,n)
		printf("%lld%c",w[i][j]," \n"[j==n]);
	return 0;
}