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.io.BufferedReader;
import java.io.InputStreamReader;

public class OddMagicSquare {
	public static void main(String[] args) throws Exception{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(in.readLine());
		int n2 = (int)Math.pow(n, 2);
		int[][] mat = new int[n][n];
		int row = 0;
		int col = n/2;
		mat[row][col] = 1;
		int item = 2;
		for(;item<=n2;item++){
//			System.out.println("row = "+row+" col = "+col);
			int tempR = row-1;
			int tempC = col+1;
//			System.out.println("new tempR = "+tempR+" new tempC = "+tempC);

			if(tempR==-1&&tempC==n){
//				System.out.println("1c");
				tempR = row+1;
				tempC = col;
			}
			else if(tempC == n){
//				System.out.println("2c");
				tempC = 0;
			}
			else if(tempR == -1){
//				System.out.println("3c");
				tempR = n-1;
			}
			if(mat[tempR][tempC]!=0){
//				System.out.println("4c");
				tempR = row+1;
				tempC = col;
			}
//			System.out.println("final tempR = "+tempR+" final tempC = "+tempC);
			mat[tempR][tempC] = item;
			row = tempR;
			col = tempC;
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				System.out.print(mat[i][j]+" ");
			}
			System.out.println();
		}
	}
}