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>
using namespace std;
typedef long long ll;
const int N=1e4+10;
int p[N],lim=10000,p1;
int flag[N];
int q[N],q1;
ll a[505][505];
map<int,int> px,py;
int n;
void prep(int n){
	for (int i=2;i<=n;i++){
		if (!flag[i])p[++p1]=i;
		for (int j=1;j<=p1;j++){
			int x=i*p[j];
			if (x>n)break;
			flag[x]=1;
			if (i%p[j]==0)break;
		}
	}
}
ll gcd(ll a,ll b){
	return b?gcd(b,a%b):a;
}
ll lcm(ll a,ll b){
	if (!a||!b)return a+b;
	return a/gcd(a,b)*b;
}
int main(){
	cin>>n;
	if (n==2){
		cout<<"4 7\n23 10\n";
		return 0;
	}
	prep(lim);
	p1=0;p[0]=1;
	for (int i=0,j=999;i<j;i++,j--)
		q[++q1]=p[i],q[++q1]=p[j];
	p1=0;
	for (int i=1;i<=n;i++){
		for (int j=1;j<=n;j++){
			if ((i+j)&1)continue;
			if (!px[i+j])px[i+j]=q[++p1];
//			if (!py[i-j])py[i-j]=q[++p1];
//			a[i][j]=px[i+j]*py[i-j];
		}
	}
	for (int i=1;i<=n;i++){
		for (int j=1;j<=n;j++){
			if ((i+j)&1)continue;
			if (!py[i-j])py[i-j]=q[++p1];
			a[i][j]=px[i+j]*py[i-j];
		}
	}
//	cout<<q[p1]<<endl;
	ll mx=0;
	for (int i=1;i<=n;i++){
		for (int j=1;j<=n;j++){
			if ((i+j)&1);else continue;
			a[i][j]=lcm(lcm(a[i-1][j],a[i][j-1]),lcm(a[i+1][j],a[i][j+1]))+1;
			mx=max(mx,a[i][j]);
			if (a[i][j]>1e15){
				cout<<px[i+j-1]<<' '<<px[i+j+1]<<endl;
				cout<<py[i-j-1]<<' '<<py[i-j+1]<<endl;
				cout<<i<<' '<<j<<endl;
			}
		}
	}
	for (int i=1;i<=n;i++){
		for (int j=1;j<=n;j++){
			printf("%lld ",a[i][j]);
		}
		printf("\n");
	}
//	cout<<mx<<endl;
}