#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll a1[13]={1,2,4,7,12,20,33,54,88,143};
ll n,an[15][15],no=1;
bool vi[15];
int main(){
	cin>>n;
	for (int i=1;i<=n;i++)an[i][i]=0;
	for (int i=1;i<=n;i++){
		for (int j=i+1;j<=n;j++)an[i][j]=an[j][i]=no*a1[j-i-1];
		no*=a1[n-i];
	}
	if (n==10){an[8][10]=an[10][8]=25979230488;an[9][10]=an[10][9]=38734963162;}
	for (int i=1;i<=n;i++){
		for (int j=1;j<=n;j++)cout<<an[i][j]<<' ';
		cout<<endl;
	}
	return 0;
}