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:
#pragma GCC optimize (2)
#pragma G++ optimize (2)
#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define MAX 505
using namespace std;
//char nc()
//{
//	static char buf[100000],*p1=buf,*p2=buf;
//	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
//}
char nc(){return getchar();}
int read()
{
	int x=0,y=1;
	char c=nc();
	while(!isdigit(c))
	{
		if(c=='-')y=-1;
		c=nc();
	}
	while(isdigit(c))
	{
		x=(x<<1)+(x<<3)+(c^48);
		c=nc();
	}
	return x*y;
}
int n,prime[MAX<<1],vst[10005];
void pre(int up)
{
	for(int i=2;;i++)
	{
		if(!vst[i])
		{
			prime[++prime[0]]=i;
			if(prime[0]==up) break;
		}
		for(int j=1;j<=prime[0];j++)
		{
			if(i*prime[j]>10000) break;
			vst[i*prime[j]]=1;
			if(!(i%prime[j])) break;
		}
	}
}
long long gcd(long long a,long long b)
{
	if(a<b) swap(a,b);
	while(b)
	{
		a%=b;
		swap(a,b);
	}
	return a;
}
long long lcm(long long a,long long b)
{
	if(!a||!b) return a|b;
	return a/gcd(a,b)*b;
}
long long a[MAX][MAX];
int main()
{
	n=read();
	if(n==2) return printf("4 7\n23 10"),0;
	pre((n&1)?n*2:n*2-1);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(!((i+j)&1))
				a[i][j]=1ll*prime[(i+j)/2]*prime[n+(i-j)/2+(n+1)/2];
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if((i+j)&1)
				a[i][j]=lcm(lcm(a[i-1][j],a[i][j-1]),lcm(a[i+1][j],a[i][j+1]))+1;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
			printf("%lld ",a[i][j]);
		putchar('\n');
	}
	return 0;
}