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
using namespace std;
const int N = 101000;
int g[N],pri[N],tot;
ll f[1010][1010],p1[1010],p2[1010];
void init(){
	for(int i=2;i<=10000;i++){
		if(!g[i]){pri[++tot]=i;g[i]=i;}
		for(int j=1;pri[j]*i<=10000;j++){
			g[pri[j]*i]=pri[j];
			if(pri[j]==g[i]) break; 
		}
	}
	int k1=0,k2=0;
	for(int i=1;i<=1004;i++)
		if(i&1) p1[++k1]=pri[i];
		else p2[++k2]=pri[i];
	ll p[1010],now=0;
	memcpy(p,p1,sizeof(p1));
	for(int i=1;i<=k1;i+=2)
		p1[i]=p[k1-now],p1[i+1]=p[++now];
	memcpy(p,p2,sizeof(p));now=0;
	for(int i=1;i<=k2;i+=2)
		p2[i]=p[k2-now],p2[i+1]=p[++now];
}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){
	if(a==0) return b;
	if(b==0) return a;
	return a/gcd(a,b)*b;
}
int main(){
	int n;
	cin>>n;
	if(n==2){
		puts("4 7\n23 10\n");
		return 0;
	}
	init();
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(i+j&1){
				int k=i+j>>1;
				f[i][j]=p1[k];
				k=i+(n-j+1)>>1;
				f[i][j]*=p2[k];
			}
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(~(i+j)&1){
				f[i][j]=lcm(f[i][j-1],lcm(f[i][j+1],lcm(f[i-1][j],f[i+1][j])))+1;
		 	}
	/*set<ll> S;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++){
			if(j<n&&max(f[i][j],f[i][j+1])%min(f[i][j],f[i][j+1])!=1) cerr<<"!!\n";
			if(i<n&&max(f[i][j],f[i+1][j])%min(f[i][j],f[i+1][j])!=1) cerr<<"!!\n";
			if(S.count(f[i][j])) cerr<<i<<' '<<j<<'\n';
			else S.insert(f[i][j]);
		}*/
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			cout<<f[i][j]<<" \n"[j==n];
	return 0;
}