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<stdio.h>
#include<vector>
#include<algorithm>
#include<deque>
using namespace std;
typedef long long ll;
int pr[101010];
ll ans[555][555];
ll gcd(ll a, ll b)
{
	for (;;)
	{
		if (a < b)swap(a, b);
		a %= b;
		if (a == 0)return b;
	}
}
ll lcm(ll a, ll b)
{
	if (a == 0 || b == 0)return max(a, b);
	return a*b / gcd(a, b);
}
int main()
{
	int num;
	scanf("%d", &num);
	deque<ll>v;
	for (int i = 2; i <= 10000; i++)
	{
		if (pr[i] == 0)
		{
			for (int j = i + i; j <= 10000; j += i)pr[j] = -1;
			if (i >= 30 && v.size() < num * 2 + 100)v.push_back(i);
		}
	}
	deque<ll>x, y;
	for (int i = 0; i < v.size(); i++)
	{
		if (i % 4 == 0)x.push_back(v[i]);
		if (i % 4 == 1)x.push_front(v[i]);
		if (i % 4 == 2)y.push_back(v[i]);
		if (i % 4 == 3)y.push_front(v[i]);
	}
	for (int i = 0; i < num + 5; i++)
	{
		for (int j = 0; j < num + 5; j++)
		{
			if ((i + j) % 2 == 0)
			{
				ans[i][j] = x[(i + j) / 2] * y[(i - j + num + 5) / 2];
			}
		}
	}
	for (int i = 1; i <= num; i++)
	{
		for (int j = 1; j <= num; j++)
		{
			if ((i + j) % 2 != 0)
			{
				ll t = x[(i + j - 1) / 2] * y[(i - j + num + 5 - 1) / 2] * x[(i + j + 1) / 2] * y[(i - j + num + 5 + 1) / 2];
				ans[i][j] = t + 1;
			}
			if (ans[i][j]>1000000000000000LL)abort();
			printf("%lld ", ans[i][j]);
		}
		printf("\n");
	}
}