#include<bits/stdc++.h>

using namespace std;

typedef long long LL;

const LL a[10]={0,1,2,4,7,12,20,29,38,52};
LL n,f[10];

int main(){
	scanf("%lld",&n);
	f[2]=1;
	for (LL i=3;i<n;++i) f[i]=f[i-1]*(a[i-1]+a[i-2]+1);
	for (LL i=1;i<=n;++i){
		for (LL j=1;j<=n;++j){
			if (i==j) printf("%lld ",0LL);
			else printf("%lld ",f[max(i,j)-1]*a[min(i,j)]+1);
		}
		puts("");
	}
	
	return 0;
}
			