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<algorithm>
using namespace std;
int w[2010], cnt, n, dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
long long Res[600][600];
long long gcd(long long a, long long b) {
	return b ? gcd(b, a%b) : a;
}
int main() {
	int i, j, pv = 0;
	for (i = 2;; i++) {
		for (j = 2; j*j <= i; j++) {
			if (i%j == 0)break;
		}
		if (j*j > i)w[++cnt] = i;
		if (cnt >= 2000)break;
	}
	scanf("%d", &n);
	for (i = 3; i <= n + n; i += 2) {
		pv++;
		for (j = 1; j <= n; j++) {
			int x = j, y = i - j;
			if (1 > y || y > n)continue;
			Res[x][y] = w[pv];
		}
	}
	for (i = n/2*2+2-1; i >= -n; i -= 2) {
		pv++;
		for (j = 1; j <= n; j++) {
			int x = j, y = i + j;
			if (1 > y || y > n)continue;
			Res[x][y] *= w[pv];
		}
	}
	long long Mx = -1e9;
	for (i = 1; i <= n; i++) {
		for (j = 1; j <= n; j++) {
			if ((i + j) % 2 == 0) {
				long long r = 1;
				for (int k = 0; k < 4; k++) {
					int x = i + dx[k], y = j + dy[k];
					if (x<1 || x>n || y<1 || y>n)continue;
					r = r / gcd(r, Res[x][y])*Res[x][y];
				}
				Mx = max(Mx, r);
				Res[i][j] = r + 1;
			}
		}
	}
	if (n == 2) {
		puts("4 7");
		puts("23 10");
		return 0;
	}
	for (i = 1; i <= n; i++) {
		for (j = 1; j <= n; j++)printf("%lld ", Res[i][j]);
		puts("\n");
	}	
}