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 Tasks {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		if (n==1) {System.out.println(1); return;}
		int s=1;
		int t=2;
		int [][] q = new int[n+1][n+1];
		int block=n*n/2+1-2*n+1;
		//System.out.println(block);
		
		for (int i=1;i<=n;i++)
		{
			for (int j=1;j<=n;j++)
			{
				q[i][j]=-1;
			}
		}
		
		for (int i=1;i<=n;i++)
		{
			for (int j=1;j<=n;j++)
			{
				if (i==n/2+1 || j==n/2+1) {q[i][j]=s;s+=2;}
			}
		}
		
int k=0;
			for (int i = 1; i <= n; i++) {	
				if (k==block/4) break;
				for (int j = 1; j <= n; j++) {	
					if (i<n && j<n && q[i][j] == -1 && q[i+1][j] == -1 && q[i][j+1] == -1 && q[i+1][j+1] == -1)
							{ q[i][j] = s; s+=2;
							q[i+1][j] =s; s+=2;
							q[i][j+1]=s;s+=2; 
							q[i+1][j+1] =s;s+=2;
							k++;
							if (k==block/4) break;
							}
				}
			}

			for (int i=1;i<=n;i++)
			{
				for (int j=1;j<=n;j++)
				{
					if (q[i][j]==-1){ q[i][j]=t; t+=2;}
				}
			}
			
		
		for (int i=1;i<=n;i++)
		{
			for (int j=1;j<=n;j++)
			{
				System.out.print(q[i][j]);
				System.out.print(' ');
			}
			System.out.println();
		}
		
//		for (int i=1;i<=n;i++)
//		{
//			for (int j=1;j<=n;j++)
//			{
//				if (i!=n/2+1 && j!=n/2+1 && t<n*n)
//					{ System.out.print(t); System.out.print(' ');t+=2;}
//				else { System.out.print(s); System.out.print(' ');s+=2;}
//			}
//			System.out.println();
//		}
		

		
	}
}