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<algorithm>
#include<vector>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;

using namespace std;
#define N 510
ll a[N][N];
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    return b?gcd(a%b,b):a;
}
ll gce(ll a,ll b){return a/gcd(a,b)*b;}
int main(){
    vector<ll> p;
    for(ll i=2;p.size()<N*3;i++){
	bool ok=1;for(auto x:p)ok&=i%x>0;
	if(ok)p.push_back(i);
    }
    lol(i,N)lol(j,N){
	if((i+j)%2==0)a[i][j]=p[(i+j)/2]*p[(i-j)/2+2*N];
    }
    lol(i,N)lol(j,N){
	if((i+j)%2==1){
	    ll p=1,dx[]={0,1,0,-1},dy[]={1,0,-1,0};
	    lol(r,4){
		ll xx=j+dx[r],yy=i+dy[r];
		if(xx<0||xx==N||yy<0||yy==N)continue;
		p=gce(p,a[yy][xx]);
	    }
	    a[i][j]=p+1;
	}
    }
    ll maxi=0;
    lol(i,N)lol(j,N)maxi=max(maxi,a[i][j]);
    //cout<<maxi<<endl;
    ll n;cin>>n;
    lol(i,n){
	lol(j,n){if(j)cout<<" ";
	    cout<<a[i+1][j+1];
	}
	cout<<endl;
    }
    return 0;
}