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 <bits/stdc++.h>

using namespace std;

long gcd(long a, long b) {
	for (; b; swap(a, b))
		a %= b;
	return a;
}
long lcm(long a, long b) {
	a /= gcd(a, b);
	if (double(a)*b > 1e15)
		throw 0;
	return a * b;
}
long lcm(long a[]) {
	return lcm(lcm(a[0], a[1]), lcm(a[2], a[3]));
}
long a[555][555];
int p[10000];
vector<int> q;
int main() {
	for (int i = 2; i < 100; i++)
		if (!p[i]) for (int j = i * i; j < 10000; j += i)
			p[j] = 1;
	for (int i = 2; i < 10000; i++)
		if (!p[i]) q.push_back(i);
	int N;
	cin >> N;
	int n = min(N * 2, 500);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if ((i + j) % 2) continue;
			a[i][j] = q[(i + j) / 2] * q[(n - 2 + i - j) / 2 + n];
		}
	}
	int s[] = { 0,1,0,-1,0 };
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if ((i + j) % 2 == 0) continue;
			long y[] = { 1,1,1,1 };
			for (int k = 0; k < 4; k++)
				if (i + s[k] >= 0 && i + s[k] < n&&j + s[k + 1] >= 0 && j + s[k + 1] < n)
					y[k] = a[i + s[k]][j + s[k + 1]];
			a[i][j] = lcm(y) + 1;
		}
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++)
			cout << a[i][j] << ' ';
		cout << '\n';
	}
	cout << flush;
	return 0;
}