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:
// MagicSquare.java
import java.util.Scanner;
public class MagicSquare3
{
	public static void main(String[] args)
	{
	Scanner input = new Scanner(System.in);
	int i,j,l,u,even,odd,counter,n;
	n=3;
	odd=3;
	even=2;
	int x = input.nextInt();
	int[][] array = new int[ x+1][ x+1];
	
	int c = x/2 + 1;
	array[c][c]=1;
	for( n = 3; n <= x; n = n+2)//for loop 4
	{
	l=c-n/2;
	u=c+n/2;

	for(i = l+1; i < c+n/2; i++)// for loop 2
	{
	array[i][l]=odd;
	odd=odd+2;
	array[i][u]=odd;
	odd=odd+2;
	}
	
	

	for(j= l; j<= u;j++)// for loop 3
	{


		if(j == c)
		{
		array[l][j]=odd;
		odd=odd+2;
		array[u][j]=odd;
		odd=odd+2;
		continue;
		}	
		
	array[l][j]=even;
	even=even+2;
	array[u][j]=even;
	even=even+2;
	
	}
	
	}//end for loop 4


	System.out.println();
	for(i=1;i<=x;i++)
	{
	for(j=1;j<=x;j++)
	{
	System.out.printf(" %2d ",array[i][j]);
	}
	System.out.println();
	}



	}// end method main
	}//end class MagicSquare