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 <cstring>

using namespace std;

typedef long long int LL;
const int Max_N(505);
const int Max_S(10000000);
const int dx[] = {+1, -1, +0, +0};
const int dy[] = {+0, +0, +1, -1};

constexpr LL gcd(LL a, LL b)
{
	return b == 0LL ? a : gcd(b, a % b);
}

constexpr LL lcm(LL a, LL b)
{
	return a / gcd(a, b) * b;
}

int N, ps, P[Max_S];
LL A[Max_N][Max_N];
bool Prime[Max_S];

int main()
{
	memset(Prime, true, sizeof(Prime)), Prime[0] = Prime[1] = false;
	for (int i = 2;i < Max_S;++i)
	{
		if (Prime[i])
			P[++ps] = i;
		for (int j = 1, x;j <= ps && (x = i * P[j]) < Max_S;++j)
		{
			Prime[x] = false;
			if (i % P[j] == 0)
				break;
		}
	}
	scanf("%d", &N);
	if (N == 2)
	{
		printf("%d %d\n", 4, 7);
		printf("%d %d\n", 23, 10);
		return 0;
	}
	for (int i = 1;i <= N;++i)
		for (int j = 1;j <= N;++j)
			if (!((i + j) & 1))
				A[i][j] = P[(i + j) >> 1] * 1LL * P[N + (i - j) / 2 + (N + 1) / 2];
	for (int i = 1;i <= N;++i)
	{
		for (int j = 1;j <= N;++j)
		{
			if ((i + j) & 1)
			{
				A[i][j] = 1LL;
				for (int k = 0, x, y;k < 4;++k)
					if (1 <= (x = i + dx[k]) && x <= N && 1 <= (y = j + dy[k]) && y <= N)
						A[i][j] = lcm(A[i][j], A[x][y]);
				++A[i][j];
			}
			printf("%lld ", A[i][j]);
		}
		printf("\n");
	}
	return 0;
}