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 problem_0710C {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int e = 2, o = 1;
		int[][] ans = new int[N][N];
		int accum = N/2;
		for(int i = 0; i < N/2; i++, accum--){
			for(int j = 0; j < accum; j++){
				ans[i][j] = e;
				e += 2;
			}
			for(int j = accum; j < N-accum; j++){
				ans[i][j] = o;
				o += 2;
			}
			for(int j = N - accum; j < N; j++){
				ans[i][j] = e;
				e += 2;
			}
		}
		for(int i = N/2; i < N; i++, accum++){
			for(int j = 0; j < accum; j++){
				ans[i][j] = e;
				e += 2;
			}
			for(int j = accum; j < N-accum; j++){
				ans[i][j] = o;
				o += 2;
			}
			for(int j = N - accum; j < N; j++){
				ans[i][j] = e;
				e += 2;
			}
		}
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<N;i++){
			for(int j=0;j<N;j++){
				if(j > 0) sb.append(' ');
				sb.append(ans[i][j]);
			}
			sb.append('\n');
		}
		System.out.print(sb.toString());
	}
}