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 CF;
import java.io.*;
import java.util.*;
public class A{

    public static void main(String[] args) throws NumberFormatException, IOException
    {
	Scanner bf = new Scanner(System.in);
	PrintWriter out = new PrintWriter(System.out);
	int n = bf.nextInt();
	int even = 2, odd = 1;
	for (int i = 1; i <= n/2; i++)
	{
	    for (int j = 0; j < i; j++,even+=2)
	    {
		out.print(even + " ");
	    }
	    for (int j = i; j < n-i; j++,odd+=2)
	    {
		out.print(odd + " ");
	    }
	    for (int j = n-i; j < n; j++,even+=2)
	    {
		out.print(even + " ");
	    }
	    out.println();

	}
	for (int i = 0; i < n; i++,odd+=2)
	{
	    out.print(odd + " ");
	}
	out.println();
	for (int i = n/2; i > 0; i--)
	{
	    for (int j = 0; j < i; j++,even+=2)
	    {
		out.print(even + " ");
	    }
	    for (int j = i; j < n-i; j++,odd+=2)
	    {
		out.print(odd + " ");
	    }
	    for (int j = n-i; j < n; j++,even+=2)
	    {
		out.print(even + " ");
	    }
	    out.println();
	}
	out.flush();
	out.close();
    }

    static class Scanner{
	BufferedReader bf;
	StringTokenizer st;
	public Scanner(InputStream i){
	    bf = new BufferedReader(new InputStreamReader(i));
	}
	public String next() throws IOException{
	    while(st == null || !st.hasMoreTokens())
		st = new StringTokenizer(bf.readLine());
	    return st.nextToken();
	}
	public int nextInt() throws NumberFormatException, IOException{
	    return Integer.parseInt(next());
	}
    }

}