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:
// by Balloons
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define mpr make_pair
#define debug() puts("okkkkkkkk")
#define rep(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)
 
using namespace std;
 
typedef long long LL;
 
const int inf = 1 << 30;
 
int n;
LL a[505][505];
 
LL gcd(LL a,LL b){
	return !b?a:gcd(b,a%b);
}
LL lcm(LL a,LL b){
	if(a==0)return b;
	if(b==0)return a;
	return a/gcd(a,b)*b;
}
 
int notpm[100005],pm[100005],pcnt=0;
void xxs(){
	notpm[1]=1;
	for(int i=2;i<=100000;i++){
		if(!notpm[i]){
			pm[++pcnt]=i;
		}
		for(int j=1;pm[j]*i<=100000&&j<=pcnt;j++){
			notpm[i*pm[j]]=1;
			if(i%pm[j]==0)break;
		}
	}
}
 
int main(){
	LL cnt=0;
	scanf("%d",&n);
	if(n==2){
		puts("4 7\n23 10");
		return 0;
	}
	xxs();
	
	for(int i=1;i<=n;i++){
		for(int j=(i%2==0)+1;j<=n;j+=2){
			a[i][j]=pm[(i+j)/2];
		}
	}
	
	for(int i=1;i<=n;i++){
		for(int j=(i%2==0)+1;j<=n;j+=2){
//			printf("%d %d %d\n",i,j,n+(j-i+1)/2+2);
			a[i][j]*=pm[n+(j-i+((j-i)%2==0?0:1))/2+2];
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(!a[i][j]){
				a[i][j]=lcm(lcm(lcm(a[i-1][j],a[i][j-1]),a[i][j+1]),a[i+1][j])+1;
			}
		}
	}
	LL mx=0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
//			if(a[i][j]==9223216780099161841){
//				printf("%d %d %lld %lld %lld %lld\n",i,j,a[i-1][j],a[i+1][j],a[i][j-1],a[i][j+1]);
//			}
//			mx=max(mx,a[i][j]);
			printf("%lld ",a[i][j]);
		}
		puts("");
	}
//	printf("%lld\n",mx);
 
	return 0;
}