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>

int pri[101000], tot = 0;
bool is[101000];

void init()
{
	for(int i = 2; i <= 100000; i++)
	{
		if(!is[i]) pri[++tot] = i;
		for(int j = 1; j <= tot && i * pri[j] <= 100000; j++)
		{
			is[i * pri[j]] = 1;
			if(i % pri[j] == 0) break;
		}
	}
}
long long m[1010][1010];

long long gcd(long long a, long long b) {return b == 0 ? a : gcd(b, a % b);} 
void lcm(long long &a, long long b)
{
	a = a / gcd(a, b) * b; 
}
int main()
{
	int n; scanf("%d", &n);
	if(n == 2)
	{
		printf("4 7\n23 10");
		return 0;
	}
	init();
	int j = 2;
	for(int i = 2; i <= 2 * n; i += 2)
	{
		for(int k = 0; k <= n; k++)
		{
			if(k + 1 >= 1 && k + 1 <= n && i - k >= 1 && i - k <= n) m[k + 1][i - k] = pri[j];
		}
		j++;
	}
	
	for(int i = (n / 2 * 2); i >= - n; i -= 2)
	{
		for(int k = 0; k <= n; k++)
		{
			if(k + 1 >= 1 && k + 1 <= n && i + k >= 1 && i + k <= n) m[k + 1][i + k] *= pri[j];
		}
		j++;
	}
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= n; j++)
		{
			if(!m[i][j])
			{
				m[i][j] = 1;
				if(i != 1) lcm(m[i][j], m[i - 1][j]);
				if(j != 1) lcm(m[i][j], m[i][j - 1]);
				if(i != n) lcm(m[i][j], m[i + 1][j]);
				if(j != n) lcm(m[i][j], m[i][j + 1]);
				m[i][j]++;
			}
		}
	for(int i = 1; i <= n; i++, puts(""))
		for(int j = 1; j <= n; j++) printf("%lld ",m[i][j]);
	return 0;
}