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.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class C {
	public static void main(String[] args) throws IOException {
		File inputFile = new File("entradaC");
		if (inputFile.exists())
			System.setIn(new FileInputStream(inputFile));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder out = new StringBuilder();
		String line = "";
		while ((line = in.readLine()) != null) {
			int n = Integer.parseInt(line);
			int[][] ans = new int[n][n];
			int v = 1;
			for (int i = 0; i < (n / 2); i++)
				for (int j = 0; j < (n / 2) - i; j++)
					ans[i][j] = v++ * 2;
			for (int i = 0; i < (n / 2); i++)
				for (int j = n - 1; j > (n / 2) + i; j--)
					ans[i][j] = v++ * 2;
			for (int i = n - 1, r = 0; i > (n / 2); i--, r++)
				for (int j = 0; j < (n / 2) - r; j++)
					ans[i][j] = v++ * 2;
			for (int i = n - 1, r = 0; i > (n / 2); i--, r++)
				for (int j = n - 1; j > (n / 2) + r; j--)
					ans[i][j] = v++ * 2;
			v = 0;
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if (j != 0)
						out.append(' ');
					if (ans[i][j] == 0)
						ans[i][j] = v++ * 2 + 1;
					out.append(ans[i][j]);
				}
				out.append('\n');
			}
		}
		System.out.print(out);
	}

	static int[] readInts(String line) {
		StringTokenizer st = new StringTokenizer(line.trim());
		int a[] = new int[st.countTokens()], index = 0;
		while (st.hasMoreTokens())
			a[index++] = Integer.parseInt(st.nextToken());
		return a;
	}

	static long[] readLongs(String line) {
		StringTokenizer st = new StringTokenizer(line.trim());
		long a[] = new long[st.countTokens()];
		int index = 0;
		while (st.hasMoreTokens())
			a[index++] = Long.parseLong(st.nextToken());
		return a;
	}

	static double[] readDoubles(String line) {
		StringTokenizer st = new StringTokenizer(line.trim());
		double a[] = new double[st.countTokens()];
		int index = 0;
		while (st.hasMoreTokens())
			a[index++] = Double.parseDouble(st.nextToken());
		return a;
	}
}