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.*;
import java.util.*;

public class TaskC {
	
	public static void main (String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		
		int n = sc.nextInt();
		int n2 = n >> 1;
		int[] a0 = new int[n*n/2 + 1];
		int n0 = 0;
		int[] a1 = new int[n*n/2 + 1];
		int n1 = 0;
		for (int i = 1; i <= n*n; i++) {
			if ((i & 1) == 0) {
				a0[n0] = i;
				n0++;
			} else {
				a1[n1] = i;
				n1++;
			}
		}
		int[][] a = new int[n][n];
		for (int i = 0; i <= n2; i++) {
			for (int j = 0; j < n2-i; j++) {
				n0--;
				a[i][j] = a0[n0];
			}
			for (int j = n2-i; j <= n2+i; j++) {
				n1--;
				a[i][j] = a1[n1];
			}
			for (int j = n2+i+1; j < n; j++) {
				n0--;
				a[i][j] = a0[n0];
			}
		}
		for (int i = n2+1; i < n; i++) {
			for (int j = 0; j < i-n2; j++) {
				n0--;
				a[i][j] = a0[n0];
			}
			for (int j = i-n2; j < n-i+n2; j++) {
				n1--;
				a[i][j] = a1[n1];
			}
			for (int j = n-i+n2; j < n; j++) {
				n0--;
				a[i][j] = a0[n0];
			}
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				pw.print(a[i][j]);
				pw.print(" ");
			}
			pw.println();
		}
		pw.close();		
	}
}