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;
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define MK make_pair
#define PB push_back
#define fi first
#define se second

typedef long long LL;
typedef pair<int, int> PII;
const int N=500 +10 , M= 2e6 + 10, dx[4] =  {1,-1,0,0}, dy[4]= {0,0,1,-1};

bool vis[M];
int n, m, p[M],pn=0;
LL a[N][N], b[N][N];
void PrimeMap(){
	pn =0 ; int n = 2e6  , k = sqrt(1e5+0.5);
	memset(vis, 0 , sizeof(vis));
	for (int i=2; i <= k; ++i)	if ( !vis[i] ) 
		for (int j=i+i; j<=n; j+=i) vis[j] = true;
	
	for (int i=2; i<=n; ++i)	if ( !vis[i] )
		p[ pn++] = i;
}


int main(){
	#ifdef che
	freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);
	#endif
	scanf("%d", &n );
	PrimeMap();
	
	for (int i=0; i<n; ++i){
		for (int j=0; j<n; ++j){
			int s= (i+j)>>1, d=(i-j)>>1;
			#ifdef che
			debug("(x-y)=%d, d=%d\n", i-j, d);
			#endif
			if ( (i^j)&1 ) printf("%d ", p[s+1]*p[d+n+(n>>1)+1]);
				else
			printf("%lld ",1ll*p[s+1]*p[s]*p[d+n+(n>>1)+1]*p[d+n+(n>>1)]+1);
			
		}
		puts("");
	}
	
	scanf("%d", &n);
	
	return 0;
}