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:
//package acm.cf1;
import java.util.*;
public class Main {
	static int odd,even;
	static int nextodd(){
		odd+=2;
		return odd;
	}
	static int nexteven(){
		even+=2;
		return even;
	}
	static void output(int a[][],int n){
//		System.out.println("???");
		for (int i = 1;i <= n;++i){
			for (int j = 1;j <= n;++j){
//				System.out.println(i+","+j);
				System.out.print(a[i][j] + ((j==n)?"\n":" "));
			}
		}
	}
	static void Solve(int n){
//		System.out.println("<>");
		int a[][] = new int[n+4][n+4];
		int mid = n/2+1;
		odd = -1;even = 0;
		int times = 0;
		for (int i = 1;i <= n;++i){
//			System.out.println(i);
			a[i][mid] = nextodd();
			for (int j = mid -1,k = mid + 1,t = 1;j > 0;--j,++k,++t){
				if (t > times){
					a[i][j] = nexteven();
					a[i][k] = nexteven();
				}else {
					a[i][j] = nextodd();
					a[i][k] = nextodd();
				}
			}
			if (i < mid) times++;
			else  times--;
		}
//		System.out.println("???");
		output(a,n);
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		@SuppressWarnings("resource")
		Scanner in = new Scanner (System.in);
		while (in.hasNext()){
			Solve(in.nextInt());
		}
	}

}