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 <cstdio>
template<typename Elem>
Elem gcd(Elem a,Elem b){
	if(b==0){
		return a;
	}
	return gcd(b,a%b);
}
template<typename Elem>
Elem lcm(Elem a,Elem b){
	if(a==0||b==0){
		return a+b;
	}
	return a/gcd(a,b)*b;
}
typedef long long ll;
const int Maxn=500;
const int Maxv=10000;
const int d[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
int n;
ll a[Maxn+5][Maxn+5];
bool np[Maxv+5];
int p[Maxv+5],p_len;
void init(){
	np[0]=np[1]=1;
	for(int i=2;i<=Maxv;i++){
		if(!np[i]){
			p[++p_len]=i;
			for(int j=i*i;j<=Maxv;j+=i){
				np[j]=1;
			}
		}
	}
}
int val_1[Maxn<<1|5],val_2[Maxn<<1|5];
int main(){
	init();
	scanf("%d",&n);
	if(n==2){
		puts("4 7");
		puts("23 10");
		return 0;
	}
	int id_tot=0;
	for(int i=2;i<=(n<<1);i+=2){
		val_1[i]=p[++id_tot];
	}
	int m;
	if(n&1){
		m=n+1;
		for(int i=(n<<1);i>0;i-=2){
			val_2[i]=p[++id_tot];
		}
	}
	else{
		m=n;
		for(int i=(n<<1)-2;i>0;i-=2){
			val_2[i]=p[++id_tot];
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if((i+j)&1){
				continue;
			}
			a[i][j]=1ll*val_1[i+j]*val_2[j-i+m];
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(!((i+j)&1)){
				continue;
			}
			for(int k=0;k<4;k++){
				int nx=i+d[k][0],ny=j+d[k][1];
				if(nx<1||ny<1||nx>n||ny>n){
					continue;
				}
				a[i][j]=lcm(a[i][j],a[nx][ny]);
			}
			a[i][j]++;
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			printf("%lld ",a[i][j]);
		}
		puts("");
	}
	return 0;
}