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 MagicOddSquare
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[][] m = new int[n][n];
		// 1x1
		if (n == 1)
		{
			System.out.println(1);
			System.exit(0);
		}
		// 3x3
		int c = n/2;
		for (int i = -1; i <= 1; i++)
		{
			for (int k = -1; k <= 1; k++)
			{
				if (i == 0 || k == 0)
				{
					m[c + i][c + k] = 1;
				}
			}
		}
		// Bigger
		for (int i = 2; i <= c; i++)
		{
			for (int d : new int[]{-1, 1})
			{
				m[c - d*i][c] = 1;
				for (int k = -i + 1; k < i; k++)
				{
					m[c - d*k][c - d*i] = 1;
				}
			}
		}
		// Numbers
		int even = 2, odd = 1;
		for (int i = 0; i < n; i++)
		{
			for (int k = 0; k < n; k++)
			{
				if (m[i][k] == 0)
				{
					m[i][k] = even;
					even += 2;
				}
				else
				{
					m[i][k] = odd;
					odd += 2;
				}
			}
		}
		// Print
		for (int i = 0; i < n; i++)
		{
			for (int k = 0; k < n; k++)
			{
				System.out.print(m[i][k]);
				if (k != n - 1)
				{
					System.out.print(" ");
				}
			}
			System.out.println();
		}
	}
}