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(a,b,c) for (a=b; a<=c; a++)
#define fd(a,b,c) for (a=b; a>=c; a--)
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define ll long long
//#define file
using namespace std;

int d[250001],n,i,j,k,l,l1,l2,x,y,t;
ll a[501][501],mx,s;
map<ll,bool> mp;
bool bz[1000001];

ll gcd(ll x,ll y) {ll r=x%y; while (r) x=y,y=r,r=x%y; return y;}
ll lcm(ll x,ll y) {ll s=gcd(x,y);return (x/s)*(y/s)*s;}

int main()
{
	#ifdef file
	freopen("agc027d.in","r",stdin);
	freopen("agc027d.out","w",stdout);
	#endif
	
	scanf("%d",&n),s=((n+1)/2)*((n+1)/2);
	i=2;
	while (t<s)
	{
		if (!bz[i] && !bz[i*2]) d[++t]=i,bz[i]=bz[i*2]=1;
		++i;
	}
	l1=0,l2=t+1;
	fo(i,1,n)
	{
		fo(j,1,n)
		if ((i&1) && (j&1))
		{
			if (((i+j)/2)&1)
			{
				++l1;
				a[i][j]=d[l1];
				if (i<n && j<n)
				a[i+1][j+1]=d[l1]*2;
			}
			else
			{
				--l2;
				a[i][j]=d[l2];
				if (i<n && j<n)
				a[i+1][j+1]=d[l2]*2;
			}
		}
	}
	fo(i,1,n) fo(j,1,n) if (a[i][j]) mp[a[i][j]]=1;
	
	mx=0;
	fo(i,1,n)
	{
		fo(j,1,n)
		if (!a[i][j])
		{
			a[i][j]=1;
			if (i>1) a[i][j]=lcm(a[i][j],a[i-1][j]);
			if (i<n) a[i][j]=lcm(a[i][j],a[i+1][j]);
			if (j>1) a[i][j]=lcm(a[i][j],a[i][j-1]);
			if (j<n) a[i][j]=lcm(a[i][j],a[i][j+1]);
			
			s=a[i][j],++a[i][j];
			while (mp[a[i][j]]) a[i][j]+=s;
			mp[a[i][j]]=1;
			mx=max(mx,a[i][j]);
		}
	}
	fo(i,1,n)
	{
		fo(j,1,n)
		printf("%lld ",a[i][j]);
		printf("\n");
	}
	
	fclose(stdin);
	fclose(stdout);
	return 0;
}