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 fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
using namespace std;
typedef long long ll;
const int N=3583;
int i,j,M,n,m,cnt,c[505];bool bz[N+5];
ll a[505][505],p;
int main(){
	c[0]=1;
	fo(i,2,N)if (!bz[i]) {
		c[++cnt]=i;
		for(j=i<<1;j<=N;j+=i) bz[j]=1;
	}
	scanf("%d",&n);
	M=n/2+1;
	fo(i,1,n){
		p=i&1?c[i/2+1]:c[i/2]*2;
		for(j=2-(i&1),m=M+1;j<=n;j+=2,m++) a[i][j]=p*c[m];
	}
	fo(i,1,n){
		p=(i&1?2:4)*c[i/2]*c[i/2+1];
		if (!(i&1)) a[i][j=1]=p*c[M+1]+1,m=M+1;else
		a[i][j=2]=p*c[M+1]*c[M+2]+1,m=M+2;
		for(j+=2;j<=n;j+=2,m++) a[i][j]=p*c[m]*c[m+1]+1;
	}
	fo(i,1,n)
	fo(j,1,n) printf("%lld%c",a[i][j],j<n?' ':'\n') ;	
}