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 Main
{
	public static void main (String[] args) 
	{

		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int[][] matrix = new int[n][n];
		int[] oddhor = new int[n];
		int[] oddver = new int[n];

		
			for(int i=0;i<n;i++)
			{
				oddver[i]=min((n-i-1)*2+1,i*2+1);
				oddhor[i]=min((n-i-1)*2+1,i*2+1);
				
			}
			int oddnumber=1;
			int evennumber=2;

			for(int i=0;i<n;i++)
			{
				int point=(n-oddver[i])/2;
				for(int j=0;j<oddver[i];j++)
				{
					matrix[i][point]=oddnumber;
					oddnumber+=2;
					point++;

				}
			}

			for(int i=0;i<n;i++)
			{
				
				for(int j=0;j<n;j++)
				{
						if(matrix[i][j]==0)
						{
							matrix[i][j]=evennumber;
							evennumber=evennumber+2;
						}
						System.out.print(matrix[i][j]+" ");
				}
						System.out.println();
			
			}
		
		
		
			
			in.close();
		}

		public static int min(int a,int b)
		{
			if(a<b)
			{
				return a;
			}
			else 
				return b;
		}
	}