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 min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define for1(a,b,i) for(int i=a;i<=b;++i)
#define FOR2(a,b,i) for(int i=a;i>=b;--i)
using namespace std;
typedef long long ll;
inline int read() {
    int f=1,sum=0;
    char x=getchar();
    for(;(x<'0'||x>'9');x=getchar()) if(x=='-') f=-1;
    for(;x>='0'&&x<='9';x=getchar()) sum=sum*10+x-'0';
    return f*sum;
}

#define M 505
#define N 8000
int n;
ll a[M][M];
int prime[N+5];
bool notprime[N+5];

map <ll,bool> cc;

void get_prime() {
    for1(2,N,i) {
        if(!notprime[i]) prime[++prime[0]]=i;
        for1(1,prime[0],j) {
            if(i*prime[j]>N) break;
            notprime[i*prime[j]]=1;
            if(!(i%prime[j])) break;
        }
    }
}

inline ll gcd(ll x,ll y) {return y?gcd(y,x%y):x;}
inline ll Lcm(ll x,ll y) {return x/gcd(x,y)*y;}

int main () {
    //freopen("a.in","r",stdin);
    n=read();
    if(n==2) {
        puts("4 7");
        puts("23 10");
        return 0;
    }
    get_prime();
    for1(0,n+1,i) for1(0,n+1,j) a[i][j]=1;
    for1(1,n,i) for1(1,n,j) if(!(i+j&1)) a[i][j]=prime[(i+j)/2]*prime[1000-(i-j)/2-(n+1)/2+1];
    for1(1,n,i) for1(1,n,j) if(i+j&1) a[i][j]=Lcm(Lcm(a[i-1][j],a[i][j-1]),Lcm(a[i][j+1],a[i+1][j]))+1;
    for1(1,n,i) {
        for1(1,n,j) printf("%lld ",a[i][j]);
        puts("");
    }
}