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>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<set>
using namespace std;
typedef long long ll;
const int N=20005;
set<ll> st;
int n,i,j,k,p[N],l,w1[N],w2[N];
bool v[N];
ll a[505][505];
ll gcd(ll a,ll b)
{
	if(!b)
		return a;
	return gcd(b,a%b);
}
ll LCM(ll a,ll b,ll c,ll d)
{
	ll rtn=a/gcd(a,b)*b;
	rtn=rtn/gcd(rtn,c)*c;
	rtn=rtn/gcd(rtn,d)*d;
	return rtn;
}
int main()
{
	scanf("%d",&n);
	for(i=2;i<=20000;++i)
	{
		if(!v[i])
			p[++l]=i;
		for(j=1;j<=l&&p[j]*i<=20000;++j)
		{
			v[p[j]*i]=true;
			if(i%p[j]==0)
				break;
		}
	}
	for(i=1;i<=n;++i)
		w1[i]=p[i];
	for(i=1;i<=n;++i)
		w2[i]=p[n+i];
	random_shuffle(w1+1,w1+1+n);
	random_shuffle(w2+1,w2+1+n);
	for(i=1;i<=n;++i)
		for(j=1;j<=n;++j)
			if((i+j)%2==0)
				a[i][j]=w1[(i+j)/2]*w2[(i-j+n+1)/2];
	for(i=0;i<=n+1;++i)
		a[0][i]=a[n+1][i]=a[i][0]=a[i][n+1]=1;
	for(i=1;i<=n;++i)
		for(j=1;j<=n;++j)
			if((i+j)&1)
			{
				a[i][j]=LCM(a[i-1][j],a[i+1][j],a[i][j-1],a[i][j+1])+1;
				while(st.count(a[i][j]))
					a[i][j]+=LCM(a[i-1][j],a[i+1][j],a[i][j-1],a[i][j+1]);
				st.insert(a[i][j]);
			}
	for(i=1;i<=n;++i)
	{
		for(j=1;j<=n;++j)
			printf("%lld ",a[i][j]);
		puts("");
	}
	return 0;
}