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.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if (n==2) {
			System.out.println("4 7");
			System.out.println("23 10");
			return;
		}
		
		int snt[] = new int[n * 2];

		int cn = 0;
		int x = 2;
		while (cn < n * 2) {
			if (isSNT(x)) {
				snt[cn] = x;
				cn++;
			}
			x++;
		}

		long[][] a = new long[n][n];
		for (int i = 0; i < n; i++) {
			for (int j = i % 2; j < n; j += 2) {
				int a1 = (i + j) / 2;
				int a2 = (j - i + n - 1) / 2 + n;
				a[i][j] = snt[a1] * snt[a2];
			}
		}



		int dx[] = { -1, 0, 1, 0 };
		int dy[] = { 0, 1, 0, -1 };
		for (int i = 0; i < n; i++) {
			for (int j = (i + 1) % 2; j < n; j += 2) {
				long gcd = 0;
				long tich = 1;
				for (int k = 0; k < 4; k++) {
					if (i + dx[k] < 0 || i + dx[k] >= n)
						continue;
					if (j + dy[k] < 0 || j + dy[k] >= n)
						continue;
					if (gcd == 0) {
						gcd = a[i + dx[k]][j + dy[k]];
						tich = gcd;
					} else {
						gcd = gcd(tich, a[i + dx[k]][j + dy[k]]);
						tich = tich / gcd * a[i + dx[k]][j + dy[k]];
					}
				}
				a[i][j] = tich+1;

			}
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				System.out.print(a[i][j] + " ");
			}
			System.out.println();
		}
	}

	private static boolean isSNT(int x) {
		for (int i = 2; i * i <= x; i++)
			if (x % i == 0)
				return false;
		return true;
	}

	private static long gcd(long a, long b) {
		return (b == 0) ? a : gcd(b, a % b);
	}
}