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 cs const
#define pb push_back
using namespace std;
typedef long long ll;
cs int N = 1e3 + 50, M = 2e4;
int n, a[N], b[N]; bool isp[M];
ll mp[N][N]; int prm[M], pc;
void Sieve(){
	for(int i=2; i<M&&pc<n+n; i++){
		if(!isp[i]) prm[++pc]=i;
		for(int j=1; j<=pc; j++){
			if(prm[j]*i>=M) break;
			isp[prm[j]*i]=true; if(i%prm[j]==0) break;
		}
	}
}
ll gcd(ll x, ll y){ return !y ? x : gcd(y, x % y); }
ll lcm(ll x, ll y){
	if(!x||!y) return x+y; 
	return x / gcd(x,y) * y;
}
int main(){
	scanf("%d",&n); Sieve();
	if(n==2) return cout<<"4 7\n23 10",0;
	int l=1, r=pc; 
	for(int i=1; i<=n; i++)
	a[i]=(i&1)?prm[l++]:prm[r--];
	for(int i=1; i<=n; i++)
	b[i]=(i&1)?prm[l++]:prm[r--];
	for(int i=1; i<=n; i++)
	for(int j=1; j<=n; j++) if((i+j)&1^1){
		int x=(i+j)>>1, y=(j+(n-i+1))>>1;
		mp[i][j]=(ll)a[x]*b[y];
	} for(int i=1; i<=n; i++)
	for(int j=1; j<=n; j++) if((i+j)&1){
		ll x=lcm(mp[i][j-1],mp[i-1][j]);
		ll y=lcm(mp[i+1][j],mp[i][j+1]); 
		mp[i][j]=lcm(x,y)+1; 
	} 
	for(int i=1; i<=n; i++,puts(""))
	for(int j=1; j<=n; j++) cout<<mp[i][j]<<" ";
	return 0;
}