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 <iostream>
#include <vector>
#include <algorithm>
#define llint long long

using namespace std;

llint n;
bool prime[5000005];
vector<llint> pvec, rvec, vec;
llint ans[505][505];

llint gcd(llint a, llint b)
{
	if(b == 0) return a;
	return gcd(b, a%b);
}
llint lcm(llint a, llint b)
{
	return a / gcd(a, b) * b;
}

int main(void)
{
	cin >> n;
	
	for(int i = 2; i < 5000005; i++){
		if(prime[i]) continue;
		for(int j = 2*i; j < 5000005; j+=i) prime[j] = true;
	}
	for(int i = 2; i < 5000005; i++) if(!prime[i]) pvec.push_back(i);
	
	pvec.resize(1000);
	rvec = pvec;
	reverse(rvec.begin(), rvec.end());
	
	for(int i = 0; i < 500; i++){
		vec.push_back(pvec[i]);
		vec.push_back(rvec[i]);
	}
	
	for(int i = 0; i < 500; i++){
		for(int j = 0; j < 500; j++){
			ans[i][j] = 1;
		}
	}
	
	for(int i = 0; i < 500; i++){
		for(int j = 0; j < 500; j++){
			if((i+j)%2) continue;
			ans[i][j] *= vec[(i+j)/2];
		}
	}
	for(int i = 0; i < 500; i++){
		for(int j = 0; j < 500; j++){
			if((i-j+500)%2) continue;
			ans[i][j] *= vec[(i-j+500)/2 + 500];
		}
	}
	for(int i = 0; i < 500; i++){
		for(int j = 0; j < 500; j++){
			if(ans[i][j] != 1) continue;
			if(i-1 >= 0) ans[i][j] = lcm(ans[i][j], ans[i-1][j]);
			if(i+1 < 500) ans[i][j] = lcm(ans[i][j], ans[i+1][j]);
			if(j-1 >= 0) ans[i][j] = lcm(ans[i][j], ans[i][j-1]);
			if(j+1 < 500) ans[i][j] = lcm(ans[i][j], ans[i][j+1]);
			ans[i][j]++;
		}
	}
	
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			cout << ans[i][j] << " ";
		}
		cout << endl;
	}
	
	return 0;
}