Problem: Find an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd.

Input

The only line contains odd integer n (1 ≤ n ≤ 49).

Output

Print n lines with n integers. All the integers should be different and from 1 to n2. The sum in each row, column and both main diagonals should be odd.

Examples

Input

1


Output

1


Input

3


Output

2 1 4
3 5 7
6 9 8

Solution (in JAVA):

Solution:
import java.util.Scanner;

public class Solution {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] odds = new int[n * n / 2 + 1];
		int[] evens = new int[n * n / 2];
		int oddIndex = 0;
		int evenIndex = 0;
		for (int i = 1; i <= n * n; i++) {
			if (i % 2 == 0) {
				evens[evenIndex++] = i;
			}
			else {
				odds[oddIndex++] = i;
			}
		}
		oddIndex = 0;
		evenIndex = 0;
		for (int i = 0; i <= n / 2; i++) {
			int oddCount = i * 2 + 1;
			int evenCount = (n - oddCount) / 2;
			String builder = "";
			for (int j = 0; j < evenCount; j++) {
				builder += evens[evenIndex++] + " ";
			}
			for (int j = 0; j < oddCount; j++) {
				builder += odds[oddIndex++] + " ";
			}
			for (int j = 0; j < evenCount; j++) {
				builder += evens[evenIndex++] + " ";
			}
			System.out.println(builder);
		}
		for (int i = n / 2 - 1; i >= 0; i--) {
			int oddCount = i * 2 + 1;
			int evenCount = (n - oddCount) / 2;
			String builder = "";
			for (int j = 0; j < evenCount; j++) {
				builder += evens[evenIndex++] + " ";
			}
			for (int j = 0; j < oddCount; j++) {
				builder += odds[oddIndex++] + " ";
			}
			for (int j = 0; j < evenCount; j++) {
				builder += evens[evenIndex++] + " ";
			}
			System.out.println(builder);
		}
		in.close();
	}
}