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:
/* - - - - - - - - - - - - - - -
	User : 		VanishD
	problem :
	Points : 	
- - - - - - - - - - - - - - - */
# include <bits/stdc++.h>
# define 	ll 		long long
using namespace std;
const int inf = 0x3f3f3f3f, INF = 0x7fffffff;
const ll  infll = 0x3f3f3f3f3f3f3f3fll, INFll = 0x7fffffffffffffffll;
int read(){
	int tmp = 0, fh = 1; char ch = getchar();
	while (ch < '0' || ch > '9'){ if (ch == '-') fh = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9'){ tmp = tmp * 10 + ch - '0'; ch = getchar(); }
	return tmp * fh;
}
const int N = 100010;
ll mp[520][520];
int p[N], pnum;
bool use[N];
int n;
void prep(int n){
	use[1] = true;
	for (int i = 2; i <= n; i++){
		if (use[i] == false) p[++pnum] = i;
		for (int j = 1; 1ll * i * p[j] <= n && j <= pnum; j++){
			use[p[j] * i] = true;
			if (i % p[j] == 0) break;
		}
	}
}
int main(){
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);
	n = read();
	prep(100000);
	for (int i = 1; i <= n + 2; i++)
		for (int j = 1; j <= n + 2; j++)
			if ((i + j) % 2 == 0){
				int p1 = (i + j) / 2, p2 = (i - j) / 2 + 760;
				mp[i][j] = p[p1] * p[p2];
			} 
	for (int i = 2; i <= n + 1; i++)
		for (int j = 2; j <= n + 1; j++)
			if ((i + j) % 2 == 1){
				mp[i][j] = mp[i - 1][j] * mp[i + 1][j];
				mp[i][j] += 1;
			}
	for (int i = 2; i <= n + 1; i++)
		for (int j = 2; j <= n + 1; j++)
			printf("%lld%c", mp[i][j], (j == n + 1) ? '\n' : ' ');
	return 0;
}