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 PYTHON3):

Solution:
N = int(input())
if N == 2:
    print(4,7)
    print(23,10)
    exit()

MAXN = 8000
sieve = [0,0] + [1]*MAXN
primes = []
p = 2
while p*p <= MAXN:
    if sieve[p]:
        primes.append(p)
        for q in range(2*p,MAXN+1,p):
            sieve[q] = 0
    p += 1
for q in range(p,MAXN):
    if sieve[q]:
        primes.append(q)

mem = [[[] for j in range(N)] for i in range(N)]
pi = 0
for i in range(0,2*N-1,4):
    for x in range(N):
        y = i-x
        if y >= N: continue
        if y < 0: break
        mem[y][x].append(primes[pi])
    pi += 1
for i in reversed(range(2,2*N-1,4)):
    for x in range(N):
        y = i-x
        if y >= N: continue
        if y < 0: break
        mem[y][x].append(primes[pi])
    pi += 1

ini = -((N-1)//2*2)
for i in range(ini,N,4):
    for x in range(N):
        y = x-i
        if y < 0: continue
        if y >= N: break
        mem[y][x].append(primes[pi])
    pi += 1
for i in range(ini+2,N,4):
    for x in range(N):
        y = x-i
        if y < 0: continue
        if y >= N: break
        mem[y][x].append(primes[pi])
    pi += 1

ans = [[None]*N for i in range(N)]
dxy = [(1,0),(0,1),(-1,0),(0,-1)]
for y in range(N):
    for x in range(N):
        if (x+y)%2:
            pset = set()
            for dx,dy in dxy:
                nx,ny = x+dx,y+dy
                if not 0 <= nx < N: continue
                if not 0 <= ny < N: continue
                pset.add(mem[ny][nx][0])
                pset.add(mem[ny][nx][1])
            a = 1
            for p in pset:
                a *= p
            ans[y][x] = a+1
        else:
            ans[y][x] = mem[y][x][0] * mem[y][x][1]

for row in ans:
    print(*row)