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 syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

ll gcd(ll a,ll b){
	if(!b) return a;
	return gcd(b,a%b);
}

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

const int M=500,L=10000;
ll a[M+2][M+2],n;
bool b[L];
vl p;
set<ll> st;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n;
	fill(b,b+L,1);
	for(int i=0;i<M+2;i++) fill(a[i],a[i]+M+2,1);
	for(int i=2;i<L;i++) if(b[i]){
		p.push_back(i);
		for(int j=i;j<L;j+=i) b[j]=0;
	}
	for(int i=1;i<=M;i++) for(int j=1;j<=M;j++) if((i+j)%2==0){
		ll t=p[(j-i)/2+249]*p[(i+j)/2+498];
		a[i][j]=t;st.insert(t);
	}
	for(int i=1;i<=M;i++) for(int j=1;j<=M;j++) if((i+j)%2==1){
		ll x=1;
		for(int k=0;k<4;k++) x=lcm(x,a[i+dx[k]][j+dy[k]]);
		a[i][j]=x+1;st.insert(x+1);
	}
	for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) cout<<a[i][j]<<" \n"[j==n];
}