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>
#include <iostream>
#include <map>
#include <vector>
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define value0(a) prime[(a)-1]
#define value1(b) prime[(b)+749]
using namespace std;
inline char gc() {
	return getchar();
	static char buf[100000],*l=buf,*r=buf;
	return l==r&&(r=(l=buf)+fread(buf,1,100000,stdin),l==r)?EOF:*l++;
}
template<class T> void rd(T &x) {
	x=0; int f=1,ch=gc();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=gc();}
	while(ch>='0'&&ch<='9'){x=x*10-'0'+ch;ch=gc();}
	x*=f;
}
typedef long long ll;
const int maxn=500+5;
const int dx[]={0,0,1,-1},dy[]={1,-1,0,0};
int n;
int val0[maxn<<1],val1[maxn<<1];
ll an[maxn][maxn];
bool mark[10005];
vector<int> prime; 
ll gcd(ll a,ll b) {return b==0?a:gcd(b,a%b);}
void init(int n) {
	for(int i=2;i<=n;++i) {
		if(!mark[i]) {
			prime.push_back(i);
		}
		for(int j=0;j<prime.size();++j) {
			int x=i*prime[j]; if(x>n) break;
			mark[x]=1;
			if(i%prime[j]==0) break; 
		}
	}
}
int main() {
	rd(n);
	if(n==2) {puts("4 7\n23 10"); return 0;} 
	init(10000);
	for(int i=1;i<=n;++i) for(int j=1;j<=n;++j) if((i+j)%2==0) {
		an[i][j]=value0((i+j)/2)*value1((i-j)/2);
	}
	for(int x=1;x<=n;++x) for(int y=1;y<=n;++y) if((x+y)&1) {
		an[x][y]=1;
		for(int k=0;k<4;++k) {
			int _x=x+dx[k],_y=y+dy[k];
			if(_x<1||_x>n||_y<1||_y>n) continue;
			an[x][y]=an[x][y]/gcd(an[x][y],an[_x][_y])*an[_x][_y];
		}
		++an[x][y]; 
	}
	for(int i=1;i<=n;++i) {
		for(int j=1;j<=n;++j) {
			if(j!=1) printf(" ");
			printf("%lld",an[i][j]);
		}
		printf("\n");
	}
	return 0;
}