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<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
using namespace std;
const int N=20005;
int fl[N],pri[N];
int v1[N],v2[N],n;
void init(){
	For(i,2,N-1) For(j,2,(N-1)/i) fl[i*j]=1;
	For(i,2,N-1) if (!fl[i]&&*pri<=2*n+6) pri[++*pri]=i;
	//printf("%d %d\n",*pri,pri[*pri]);
}
int main(){
	scanf("%d",&n); init();
	For(i,0,n+n+2) v1[i]=v2[i]=1;
	For(i,0,n+1){
		int v=i;
		if (v%2==0) v1[v]=pri[(*pri)--];
		if ((v+n+1)%2==0) v2[v]=pri[(*pri)--];
		v=n+n+2-i;
		if (v%2==0) v1[v]=pri[(*pri)--];
		if ((v+n+1)%2==0) v2[v]=pri[(*pri)--];
	}
	/*printf("%d %d %d\n",v1[n],v1[n+1],v1[n+2]);
	printf("%d %d %d\n",v2[n],v2[n+1],v2[n+2]);
	printf("%d\n",*pri);
	return 0;*/
	//printf("%d\n",*pri);
	For(i,1,n) For(j,1,n)
		if ((i+j)%2==0) printf("%lld%c",1ll*v1[i+j]*v2[i+n-j+1],j==n?'\n':' ');
		else printf("%lld%c",1ll*v1[i+j-1]*v1[i+j+1]*v2[i+n-j]*v2[i+n-j+2]+1,j==n?'\n':' ');
}