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 <algorithm>
#include <iostream>
#include <string.h>
#include <cstdlib>
#include <vector>
#include <string>
#include <bitset>
#include <math.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
 
typedef long long ll;
typedef long double ld;
 
const ll MOD = 1e9 + 7, INF = 1e18 + 1;
 
using namespace std;

ll er[1000001], p[1000000], ptr, n, d[1000][1000];

ll gcd (ll a, ll b)
{
	if (!b) return a;
	else return gcd (b, a % b);
}

int main ()
{
	for (ll i = 2; i <= 1000000; i++)
		if (!er[i])
		{
			p[ptr++] = i;
			for (ll j = i * i; j <= 1000000; j += i)
				er[j] = 1;
		}

	cin >> n;

	for (int i = 0; i < 2 * n; i += 2)
		for (int j = 0; i + j < 2 * n; j++)
			d[j][i + j] = p[i / 2];


	for (int i = 2; i < 2 * n; i += 2)
		for (int j = 0; i + j < 2 * n; j++)
			d[i + j][j] = p[i / 2 + (n + 1) / 2 - 1];


	for (int i = 0; i < 2 * n; i += 2)
		for (int j = 0; i >= j; j++)
			d[i - j][j] *= p[i / 2 + n];

	ll mx = 0;

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

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (!d[i][j])
			{
				ll lcm = 1;
				if (j) lcm = lcm / gcd (lcm, d[i][j-1]) * d[i][j-1];
				if (j < n - 1) lcm = lcm / gcd (lcm, d[i][j+1]) * d[i][j+1];
				if (i) lcm = lcm / gcd (lcm, d[i-1][j]) * d[i-1][j];
				if (i < n - 1) lcm = lcm / gcd (lcm, d[i+1][j]) * d[i+1][j];

				d[i][j] = lcm + 1;
			}

			printf ("%lld ", d[i][j]);
		}
		putchar ('\n');
	}
}