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 Rint register int
using namespace std;
typedef long long LL;
const int N = 1003, K = 10003, d[2][4] = {{0, 1, 0, -1}, {1, 0, -1, 0}};
int n, pri[N << 1], tot;
bool notp[K];
LL a[N][N];
inline void init(int m){
	notp[0] = notp[1] = 1;
	for(Rint i = 2;;i ++){
		if(!notp[i]){pri[++ tot] = i; if(tot == m) break;}
		for(Rint j = 1;j <= tot && i * pri[j] <= 10000;j ++){
			notp[i * pri[j]] = true;
			if(!(i % pri[j])) break;
		}
	}
}
inline LL gcd(LL a, LL b){return b ? gcd(b, a % b) : a;}
inline LL lcm(LL a, LL b){return a / gcd(a, b) * b;}
int main(){
	scanf("%d", &n);
	if(n == 2){
		puts("2 3"); puts("5 4"); return 0;
	} init(2 * n);
	for(Rint i = 1;i <= n;i ++)
		for(Rint j = 1;j <= n;j ++) if(!(i + j & 1))
			a[i][j] = pri[i + j >> 1] * pri[n + (n + i - j + 1 >> 1)];
	for(Rint i = 1;i <= n;i ++){
		for(Rint j = 1;j <= n;j ++){
			if(!a[i][j]){
				a[i][j] = 1;
				for(Rint k = 0;k < 4;k ++){
					int dx = i + d[0][k], dy = j + d[1][k];
					if(dx >= 1 && dx <= n && dy >= 1 && dy <= n)
						a[i][j] = lcm(a[i][j], a[dx][dy]);
				}
				++ a[i][j];
			}
			printf("%lld ", a[i][j]);
		}
		putchar('\n');
	}
}