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>
using ll = long long;
inline ll gcd(ll x, ll y)
{
	while (y)
	{
		auto r = x % y;
		x = y;
		y = r;
	}
	return x;
}
inline bool chk(int n)
{
	for (int i = 2; i * i <= n; i++)
	{
		if (!(n % i))
			return false;
	}
	return true;
}
inline ll lcm(ll x, ll y) { return x && y ? x / gcd(x, y) * y : x + y; }
ll pri[1005], arr[505][505];
int main()
{
	// freopen("AGC027-D.in", "r", stdin);
	int n, cur = 0, len = 0;
	scanf("%d", &n);
	bool even = n & 1 ^ 1;
	n += even;
	for (int i = 2; len <= n * 2; i++)
	{
		if (chk(i))
			pri[len++] = i;
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
			arr[i][j] = 1;
	}
	for (int i = 0; i < n; i += 2, cur++)
	{
		int x = i, y = 0;
		while (x < n && y < n)
			arr[x++][y++] *= pri[cur];
	}
	for (int i = 2; i < n; i += 2, cur++)
	{
		int x = 0, y = i;
		while (x < n && y < n)
			arr[x++][y++] *= pri[cur];
	}
	cur = len - 1;
	for (int i = 0; i < n; i += 2, cur--)
	{
		int x = i, y = 0;
		while (x >= 0 && y < n)
			arr[x--][y++] *= pri[cur];
	}
	for (int i = 2; i < n; i += 2, cur--)
	{
		int x = n - 1, y = i;
		while (x >= 0 && y < n)
			arr[x--][y++] *= pri[cur];
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = i & 1 ^ 1; j < n; j += 2)
			arr[i][j] = lcm(lcm(i ? arr[i - 1][j] : 0, j ? arr[i][j - 1] : 0),
							lcm(arr[i + 1][j], arr[i][j + 1])) + 1;
	}
	n -= even;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
			printf("%lld%c", arr[i][j], " \n"[j + 1 == n]);
	}
	return 0;
}