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.*;
import java.io.*;
public class C710 {
public static void main(String[] args) throws IOException {
	FS input = new FS(System.in);
	PrintWriter out = new PrintWriter(System.out);
	int n = input.nextInt();
	int[][] as = new int[n][n];
	for(int i = 0; i<n; i++)
		for(int j = 0; j<n; j++)
		{
			if(Math.abs(i-n/2) + Math.abs(j-n/2) <= n/2) as[i][j] = 1;
		}
	int even = 2, odd = 1;
	for(int i = 0; i<n; i++)
	{
		for(int j = 0; j<n; j++)
		{
			if(as[i][j] == 0)
			{
				out.print(even+" ");
				even += 2;
			}
			else
			{
				out.print(odd+" ");
				odd += 2;
			}
		}
		out.println();
	}
	out.close();
}

static class FS {
	BufferedReader br;
	StringTokenizer st;

	public FS(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
	}

	String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}
}
}