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;
#define ll long long
#define f(i, x, n) for(int i = x; i < (int)(n); ++i)

int const N = 500, M = 10000000;
int p[M / 10], p2[10000], sz;
ll an[N][N];
bool pr[M];

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

int main(){
	for (int i = 2; i * i < M; ++i)if (!pr[i])for (int j = i * i; j < M; j += i)pr[j] = true;
	f(i, 2, M)if (!pr[i])p[sz++] = i;
	int kk = 0;
	for (int i = 1999; i > 0; i -= 3){
		p2[kk++] = p[i];
		p2[kk++] = p[i - 1];
		p2[kk++] = p[i - 2];
		p2[kk++] = p[(1999-i) / 3];
		if (kk == 2000)break;
	}
	int n;
	scanf("%d", &n);
	if (n == 2) { printf("4 7\n23 10\n"); return 0; }
	f(i, 0, n)f(j, 0, n)an[i][j] = 1;
	kk = 0;
	for (int i = 0; i < n; i += 2, ++kk)for (int j = 0, z = i; j < n && z < n; ++j, ++z)an[z][j] *= p[kk];
	for (int j = 2; j < n; j += 2, ++kk)for (int i = 0, z = j; i < n && z < n; ++i, ++z)an[i][z] *= p[kk];
	for (int i = 0; i < 2*n - 1; i += 2, ++kk)for (int j = i < n ? 0 : i - n + 1, z = i < n ? i : n - 1; j < n && z >= 0; ++j, --z)an[z][j] *= p[kk];
	f(i, 0, n)for (int j = i + 1 & 1; j < n; j += 2)an[i][j] = 1 + lcm(i ? an[i - 1][j] : 1, lcm(i + 1 < n ? an[i + 1][j] : 1, lcm(j ? an[i][j - 1] : 1, j + 1 < n ? an[i][j + 1] : 1)));
	f(i, 0, n){
		printf("%lld", an[i][0]);
		f(j, 1, n)printf(" %lld", an[i][j]);
		printf("\n");
	}
}