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:
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

//template
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
//end

ll gcd(ll x,ll y){return (y==0?x:gcd(y,x%y));}

ll a[510][510];
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

bitset<10101> isp; vector<int> ps;
void init(){
   rep(i,2,10000)isp[i]=1;
   rep(i,2,10000)if(isp[i]){
      ps.push_back(i);
      for(int j=i*i;j<10000;j+=i)isp[j]=0;
   }
}

int main(){
   int n; cin>>n;
   if(n==2){
      cout<<"4 7"<<endl;
      cout<<"23 10"<<endl;
      return 0;
   }
   int idx=0;
   rep(i,0,n)rep(j,0,n)a[i][j]=1;
   init();
   for(int d=-n+(n&1);d<n;d+=2){
      rep(x,0,n)if(x+d>=0 and x+d<n){
         a[x][x+d]*=ps[idx];
      } idx++;
   }
   for(int d=0;d<=n*2-2;d+=2){
      rep(x,0,n)if(d-x>=0 and d-x<n){
         a[x][d-x]*=ps[idx];
      } idx++;
   }
   rep(i,0,n)rep(j,0,n)if((i+j)&1){
      a[i][j]=1;
      rep(k,0,4){
         int tx=i+dx[k],ty=j+dy[k];
         if(tx<0 or tx>=n or ty<0 or ty>=n)continue;
         a[i][j]=a[i][j]/gcd(a[i][j],a[tx][ty])*a[tx][ty];
      } a[i][j]++;
   }
   rep(i,0,n){
      rep(j,0,n)cout<<a[i][j]<<(j==n-1?'\n':' ');
   }
   return 0;
}