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

Solution:
import java.util.*;
import java.io.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                Map hs = new HashMap();
                PrintWriter ou = new PrintWriter(System.out);
                int n = Integer.parseInt(sc.next());
                sc.close();
                if(n == 2){
                        ou.print("4 7\n23 10\n");
                }else{
                        long[] sos = new long[2 * n + 1];
                        long[] sosos = new long[2 * n + 1];
                        long[][] map = new long[n][n];
                        for(int i = 0 ; i < n ; i++){
                                Arrays.fill(map[i] , 1);
                        }
                        sos[0] = 2;
                        int q = 1;
                        for(long i = 3 ; q <= 2 * n ; i++){
                                boolean ebishu = true;
                                for(int j = 2 ; j <= Math.sqrt(i) && ebishu ; j++){
                                        if(i % j == 0) ebishu = false;
                                }
                                if(ebishu){
                                        sos[q] = i;
                                        q++;
                                }
                        }
                        int aaa = 0;
                        int bbb = 2 * n;
                        for(int i = 0 ; i <= n * 2 ; i++){
                                if(i % 2 == 0){
                                        sosos[i] = sos[aaa];
                                        aaa++;
                                }else{
                                        sosos[i] = sos[bbb];
                                        bbb--;
                                }
                        }
                        for(int i = 0 ; i < n ; i++){
                                for(int j = 0 ; j < n ; j++){
                                        if((i + j) % 2 == 0){
                                                map[i][j] *= sosos[(i + j) / 2];
                                                map[i][j] *= sosos[n + (j - i + n) / 2];
                                        }
                                }
                        }
                        for(int i = 0 ; i < n ; i++){
                                for(int j = 0 ; j < n ; j++){
                                        if((i + j) % 2 != 0){
                                                if(j != 0 && j != n - 1){
                                                        map[i][j] = map[i][j + 1] * map[i][j - 1] + 1;
                                                }else{
                                                        if(i != 0 && i != n - 1){
                                                                map[i][j] = map[i + 1][j] * map[i - 1][j] + 1;
                                                        }else{
                                                                if(j == 0){
                                                                        map[n - 1][0] = map[n - 2][0] * map[n - 1][1] + 1;
                                                                }else{
                                                                        map[0][n - 1] = map[0][n - 2] * map[1][n - 1] + 1;
                                                                }
                                                        }
                                                }
                                        }
                                }
                        }
                        for(int i = 0 ; i < n ; i++){
                                for(int j = 0 ; j < n ; j++){
                                        ou.print(map[i][j]);
                                        if(j != n - 1) ou.print(" ");
                                        else ou.print("\n");
                                }
                        }
                }
                ou.flush();
        }
}