#include<bits/stdc++.h>
using namespace std;

typedef long long lint;
typedef long double louble;

#define so(a) ((int)((a).size()))

template<typename T1,typename T2> inline T1 max(T1 a,T2 b){return a<b?b:a;}
template<typename T1,typename T2> inline T1 min(T1 a,T2 b){return a<b?a:b;}

const char lf = '\n';

namespace ae86
{
	const int bufl = 1 << 15;

	char buf[bufl],*s=buf,*t=buf;

	inline int fetch()
	{
		if(s==t){t=(s=buf)+fread(buf,1,bufl,stdin);if(s==t)return EOF;}
		return *s++;
	}

	inline int ty()
	{
		int a=0;int b=1,c=fetch();
		while(!isdigit(c))b^=c=='-',c=fetch();
		while(isdigit(c))a=a*10+c-48,c=fetch();
		return b?a:-a;
	}
}
using ae86::ty;

const int _ = 11;
const int biao [] = { 0,1,2,4,7,12,20,29,38,52,73 };

int n;
lint dis[_][_]={0};

int main()
{
	ios::sync_with_stdio(0),cout.tie(nullptr);

	n=ty();

	lint now=0;
	for(int i=2;i<=n;i++)
	{
		for(int j=1;j<i;j++)
			dis[i][j]=dis[j][i]=(now+1)*biao[j];
		now=now-dis[i-1][i-2]+dis[i][i-1]+dis[i][i-2];
	}

	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			cout<<dis[i][j]<<" \n"[j==n];

	return 0;
}
