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>
#define meow(args...) fprintf(stderr, args)
typedef unsigned u32;
typedef long long s64;
typedef unsigned long long u64;
template<class T1, class T2> inline bool cmin(T1 &a, const T2 &b) {return b<a?(a=b, true):false;}
template<class T1, class T2> inline bool cmax(T1 &a, const T2 &b) {return a<b?(a=b, true):false;}
int n, prn, pr[2000], p[1000], q[1000];
s64 a[502][502];
bool vis[100000];
s64 gcd(s64 x, s64 y) {return y?gcd(y, x%y):x;}
s64 lcm(s64 x, s64 y) {return x/gcd(x, y)*y;}
int main() {
	std::cin>>n;
	if(n==2) {
		puts("4 7\n23 10");
		return 0;
	}
	for(int i=2; prn<2*n; ++i) {
		if(!vis[i]) pr[prn++]=i;
		for(int j=0; j<prn&&i*pr[j]<100000; ++j) {
			vis[i*pr[j]]=true;
			if(i%pr[j]==0) break;
		}
	}
	for(int i=1; i<=2*n-2; i+=2) p[i]=pr[--prn];
	for(int i=n&1; i<=2*n-2; i+=2) q[i]=pr[--prn];
	for(int i=0; i<=n; ++i) a[i][0]=a[0][i]=a[i][n+1]=a[n+1][i]=1;
	for(int i=1; i<=n; ++i)
		for(int j=(i&1)+1; j<=n; j+=2)
			a[i][j]=(s64)p[i+j-2]*q[i-j+n-1];
	for(int i=1; i<=n; ++i)
		for(int j=(~i&1)+1; j<=n; j+=2)
			a[i][j]=lcm(lcm(a[i-1][j], a[i+1][j]), lcm(a[i][j-1], a[i][j+1]))+1;
	for(int i=1; i<=n; ++i) {
		for(int j=1; j<=n; ++j) printf("%lld ", a[i][j]);
		puts("");
	}
	return 0;
}