Problem: You are given an integer N.

Construct any one N-by-N matrix a that satisfies the conditions below. It can be proved that a solution always exists under the constraints of this problem.

* 1 \leq a_{i,j} \leq 10^{15}
* a_{i,j} are pairwise distinct integers.
* There exists a positive integer m such that the following holds: Let x and y be two elements of the matrix that are vertically or horizontally adjacent. Then, {\rm max}(x,y) {\rm mod} {\rm min}(x,y) is always m.

Constraints

* 2 \leq N \leq 500

Input

Input is given from Standard Input in the following format:


N


Output

Print your solution in the following format:


a_{1,1} ... a_{1,N}
:
a_{N,1} ... a_{N,N}

Output

Print your solution in the following format:


a_{1,1} ... a_{1,N}
:
a_{N,1} ... a_{N,N}

Example

Input

2


Output

4 7
23 10

Solution (in CPP):

Solution:
#include<cstdio>
#define ll long long 
ll f[1050][1050];
int n,t,p[10050],pri[10050];
ll gcd(ll a,ll b){
	if (!(a%b))return b;
	return gcd(b,a%b);
}
ll lcm(int x,int y){
	ll ret=1;
	if (x>1)ret=ret/gcd(f[x-1][y],ret)*f[x-1][y];
	if (y>1)ret=ret/gcd(f[x][y-1],ret)*f[x][y-1];
	if (x<n)ret=ret/gcd(f[x+1][y],ret)*f[x+1][y];
	if (y<n)ret=ret/gcd(f[x][y+1],ret)*f[x][y+1];
	return ret+1;
}
int main(){
	for (int i=2;t<=1050;i++){
		if (!p[i])pri[++t]=i;
		for (int j=1;j<=t&&i*1ll*pri[j]<=10000;j++){
			p[i*pri[j]]=1;
			if (!(i%pri[j]))break;
		}
	}
	scanf("%d",&n);
	int tmp=1;
	for (int i=1;i<=n;i+=2,tmp++)
		for (int x=1,y=i;x<=n&&y<=n;x++,y++)f[x][y]=pri[tmp]; 
	for (int i=3;i<=n;i+=2,tmp++)
		for (int y=1,x=i;x<=n&&y<=n;x++,y++)f[x][y]=pri[tmp];
	for (int i=1;i<=n;i+=2,tmp++)
		for (int x=1,y=i;x<=n&&y;x++,y--)f[x][y]*=pri[tmp];
	for (int i=(!(n&1)?2:3);i<=n;i+=2,tmp++)
		for (int y=n,x=i;x<=n&&y;x++,y--)f[x][y]*=pri[tmp];
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)if (!f[i][j])f[i][j]=lcm(i,j);
	if (n==2)f[2][1]=61;
	for (int i=1;i<=n;i++,printf("\n"))
		for (int j=1;j<=n;j++)printf("%lld ",f[i][j]); 
}