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;

using ll = long long;
using vi = vector<int>;
#define f(i,a,b) for (int i = a; i < b; i++)
#define fr(i,a,b) for (int i = b-1; i >= a; i--)
#define pb push_back
#define IN(i,a,b) (a<=i&&i<=b)

int di[] = {0,0,1,-1};
int dj[] = {1,-1,0,0};

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

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	clock_t start = clock();
#endif

	int n; cin>>n;
	if (n==2) {
		cout << "4 7" << endl << "23 10" << endl;
	} else {
		ll a[n][n];
		int mxn = 1e5;
		int sieve[mxn];
		fill(sieve,sieve+mxn,0);
		vi primes;
		f(i,2,mxn) if (sieve[i] == 0) {
			primes.pb(i);
			for (int j = i; j <mxn; j+=i)
				sieve[j] = i;
		}
		ll x[2*n],y[2*n];
		int t = 0;
		for (int i = 0; i < 2*n; i+=2)
			x[i]=x[i+1]=primes[t++];	
		for (int j = 0; j < 2*n; j+=2)
			y[j]=y[j+1]=primes[t++];
		fr(i,0,n) y[i] = primes[t++];
		f(i,0,n) f(j,0,n) if (!((i+j)&1)) 	
			a[i][j] = x[n+i-j]*y[n+n-1-i-j];
		f(i,0,n) f(j,0,n) if ((i+j)&1) {
			ll w = 1;
			f(k,0,4) {
				int ni = i+di[k], nj = j+dj[k];
				if (IN(ni,0,n-1) && IN(nj,0,n-1)) 
					w = lcm(w,a[ni][nj]);
			}
			a[i][j] = w+1;
		}
		stringstream ss;
		f(i,0,n) f(j,0,n) ss << a[i][j] << " \n"[j+1==n];
		cout << ss.str();


	}

#ifdef LOCAL
	cout << setprecision(12) << (long double)(clock()-start) / CLOCKS_PER_SEC << endl;
#endif

	return 0;
}