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:
/****************************************************************
*	Author: huhao
*	Email: 826538400@qq.com
*	Create time: 2020-03-11 10:55:56
****************************************************************/
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#define fr(i,a,b) for(int i=(a),end_##i=(b);i<=end_##i;i++)
#define fd(i,a,b) for(int i=(a),end_##i=(b);i>=end_##i;i--)
int read()
{
	int r=0,t=1,c=getchar();
	while(c<'0'||c>'9')
	{
		t=c=='-'?-1:1;
		c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		r=(r<<3)+(r<<1)+(c^48);
		c=getchar();
	}
	return r*t;
}
#define i64 long long
const int N=1000010,M=510;
int n,v[N],p[N],c;
i64 ans[M][M];
i64 gcd(i64 a,i64 b){ return b?gcd(b,a%b):a; }
i64 lcm(i64 a,i64 b){ return a/gcd(a,b)*b; }
int main()
{
	n=1000000;
	fr(i,2,n)
	{
		if(!v[i]) p[++c]=i;
		fr(j,1,c)
			if(i*p[j]<=n)
			{
				v[i*p[j]]=1;
				if(i%p[j]==0) break;
			}
			else break;
	}
	n=read()+2;
	fr(i,0,n+1) fr(j,0,n+1) ans[i][j]=1; 
	fr(i,1,n) fr(j,1,n) if((i+j)%2==0) ans[i][j]=p[(i+j)/2]*p[(i-j)/2+2*n];
	fr(i,1,n) fr(j,1,n) if((i+j)%2==1) ans[i][j]=lcm(ans[i-1][j],lcm(ans[i+1][j],lcm(ans[i][j-1],ans[i][j+1])))+1;
	fr(i,2,n-1) fr(j,2,n-1) printf("%lld%c",ans[i][j],j==n-1?'\n':' ');
	return 0;
}