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

	public static void main(String[] args) {
		Scanner asd = new Scanner(System.in);
		int n = asd.nextInt();
		int[][] x = new int[n+1][n+1];
		
		int t = 1;
		
		int toq = 1;
		int juft = 2;
		int cnt = 0;
		
		for (int i = 1; i <= n/2+1; i++) {
			for (int j = 1; j <= n/2-t+1; j++) {
				x[i][j] = juft;
				juft+=2;
			}
			for (int j = n/2-t+2; j <= n/2+t; j++) {
				x[i][j] = toq;
				toq+=2;
			}
			for (int j = t+n/2+1; j <= n; j++) {
				x[i][j] = juft;
				juft+=2;
			}
			t++;
		}
		t-=2;
		for (int i = n/2+2; i <= n; i++) {
			for (int j = 1; j <= n/2-t+1; j++) {
				x[i][j] = juft;
				juft+=2;
			}
			for (int j = n/2-t+2; j <= n/2+t; j++) {
				x[i][j] = toq;
				toq+=2;
			}
			for (int j = t+n/2+1; j <= n; j++) {
				x[i][j] = juft;
				juft+=2;
			}
			t--;
		}
		
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				System.out.print(x[i][j] + " ");
			}
			System.out.println();
		}	
	}
}