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 For(i, j, k) for (int i = j; i <= k; i++)

using namespace std;

const int N = 2010;

typedef __int128 LL;

int n;
LL A[N][N];

int vis[N * 20], prm[N];

void init(int m) {
	int c = 0;
	For(i, 2, m) if (!vis[i]) {
		if (i != 2) prm[++c] = i;
		for (int j = i * 2; j <= m; j += i) vis[j] = true;
	}
}

LL gcd(LL x, LL y) {
	return !y ? x : gcd(y, x % y);
}

LL lcm(LL x, LL y) {
	return x * y / gcd(x, y);
}

int main() {

	scanf("%d", &n);

	if (n == 2) {
		puts("4 7\n23 10");
		return 0;
	}

	init(n * 20);

	int l = 1, r = n;
	for (int s = 2; s <= n * 2; s += 2) {
		int cur = s % 4 == 0 ? prm[l++] : prm[r--];
		For(i, 1, n) if (s - i >= 1 && s - i <= n)
			A[i][s - i] = cur;
	}
	l = n + 1, r = 2 * n;
	for (int s = n % 2 ? 2 : 3; s <= n * 2; s += 2) {
		int cur = s % 4 < 2 ? prm[l++] : prm[r--];
		For(i, 1, n) {
			int j = n + 1 + i - s;
			if (j >= 1 && j <= n) A[i][j] *= cur;
		}
	}

	For(i, 1, n) For(j, 1, n) if ((i + j) % 2) {
		LL S = 1;
		if (i > 1) S = lcm(S, A[i - 1][j]);
		if (j > 1) S = lcm(S, A[i][j - 1]);
		if (i < n) S = lcm(S, A[i + 1][j]);
		if (j < n) S = lcm(S, A[i][j + 1]);
		++S;
		A[i][j] = S;
	}

	For(i, 1, n) For(j, 1, n) printf("%lld%c", (long long)A[i][j], j == n ? '\n' : ' ');

	return 0;
}