Problem: Diverta City is a new city consisting of N towns numbered 1, 2, ..., N.

The mayor Ringo is planning to connect every pair of two different towns with a bidirectional road. The length of each road is undecided.

A Hamiltonian path is a path that starts at one of the towns and visits each of the other towns exactly once. The reversal of a Hamiltonian path is considered the same as the original Hamiltonian path.

There are N! / 2 Hamiltonian paths. Ringo wants all these paths to have distinct total lengths (the sum of the lengths of the roads on a path), to make the city diverse.

Find one such set of the lengths of the roads, under the following conditions:

* The length of each road must be a positive integer.
* The maximum total length of a Hamiltonian path must be at most 10^{11}.

Constraints

* N is a integer between 2 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:


N


Output

Print a set of the lengths of the roads that meets the objective, in the following format:


w_{1, 1} \ w_{1, 2} \ w_{1, 3} \ ... \ w_{1, N}
w_{2, 1} \ w_{2, 2} \ w_{2, 3} \ ... \ w_{2, N}
:  :     :
w_{N, 1} \ w_{N, 2} \ w_{N, 3} \ ... \ w_{N, N}


where w_{i, j} is the length of the road connecting Town i and Town j, which must satisfy the following conditions:

* w_{i, i} = 0
* w_{i, j} = w_{j, i} \ (i \neq j)
* 1 \leq w_{i, j} \leq 10^{11} \ (i \neq j)



If there are multiple sets of lengths of the roads that meet the objective, any of them will be accepted.

Examples

Input

3


Output

0 6 15
6 0 21
15 21 0


Input

4


Output

0 111 157 193
111 0 224 239
157 224 0 258
193 239 258 0

Solution (in CPP):

Solution:
#pragma GCC optimize("Ofast","inline")
#include <bits/stdc++.h>
#define clr(x) memset(x,0,sizeof x)
#define For(i,a,b) for (int i=(a);i<=(b);i++)
#define Fod(i,b,a) for (int i=(b);i>=(a);i--)
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define outval(x) cerr<<#x" = "<<x<<endl
#define outtag(x) cerr<<"---------------"#x"---------------"<<endl
#define outarr(a,L,R) cerr<<#a"["<<L<<".."<<R<<"] = ";\
						For(_x,L,R)cerr<<a[_x]<<" ";cerr<<endl;
using namespace std;
typedef long long LL;
typedef vector <int> vi;
LL read(){
	LL x=0,f=0;
	char ch=getchar();
	while (!isdigit(ch))
		f|=ch=='-',ch=getchar();
	while (isdigit(ch))
		x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return f?-x:x;
}
const int N=100;
int n,m;
LL g[N][N];
LL gg[N][N];
int a[N];
LL rand48(){
	LL a=rand()&65535,b=rand()&65535,c=rand()&65535;
	return (a<<32)^(b<<16)^c;
}
unordered_map <LL,int> mp;
int p[N];
bool check(int i){
	For(j,1,i-1)
		For(k,j+1,i-1)
			if (a[j]+a[k]==a[i])
				return 0;
	For(j,1,i-1)
		For(k,j+1,i-1)
			For(t,1,i-1)
				if (a[j]+a[k]==a[t]+a[i])
					return 0;
	return 1;
}
LL ans[N*N]={0,
0,1,2,8,56,672,13440,443520,22176000,1507968000,
1,0,4,16,112,1344,26880,887040,44352000,3015936000,
2,4,0,32,224,2688,53760,1774080,88704000,6031872000,
8,16,32,0,392,4704,94080,3104640,155232000,10555776000,
56,112,224,392,0,8064,161280,5322240,266112000,18095616000,
672,1344,2688,4704,8064,0,268800,8870400,443520000,30159360000,
13440,26880,53760,94080,161280,268800,0,12862080,643104000,43731072000,
443520,887040,1774080,3104640,5322240,8870400,12862080,0,842688000,7313164692,
22176000,44352000,88704000,155232000,266112000,443520000,643104000,842688000,0,28424716692,
1507968000,3015936000,6031872000,10555776000,18095616000,30159360000,43731072000,7313164692,28424716692,0
};
int main(){
	n=read();
	if (n==10){
		For(i,1,n){
			For(j,1,n){
				cout<<ans[(i-1)*n+j]<<" ";
			}
			cout<<endl;
		}
		return 0;
	}
	a[0]=0,a[1]=1;
	For(i,2,n-1){
		a[i]=a[i-1]+1;
		while (!check(i))
			a[i]++;
	}
//	outarr(a,1,n-1);
	LL tmp=1;
	For(i,2,n){
		For(j,1,i-1)
			gg[i][j]=gg[j][i]=tmp*a[j];
		tmp*=a[i-1]+a[i-2]+1;
	}
	while (1){
		int flag=1;
		LL mod=rand48()%100000000LL+49900000000LL;
		For(i,1,n)
			For(j,1,n)
				g[i][j]=gg[i][j]%mod;
		For(i,1,n)
			For(j,i+1,n)
				if (!g[i][j])
					flag=0;
		if (flag){
			mp.clear();
			For(i,1,n)
				p[i]=i;
			do {
				if (p[1]>p[n])
					continue;
				LL tot=0;
				For(i,1,n-1)
					tot+=g[p[i]][p[i+1]];
				if (tot>100000000000LL||mp[tot]){
					flag=0;
					break;
				}
				mp[tot]++;
			} while (next_permutation(p+1,p+n+1));
		}
		if (flag){
			For(i,1,n){
				For(j,1,n){
					cout<<g[i][j]<<" ";
				}
				cout<<endl;
			}
			break;
		}
	}
	return 0;
}