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.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;


public class C {

	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		int n = nextInt();
		int[][]a = new int[n+1][n+1];
		int x = 1;
		if (n/2 % 2==0) {
			for (int i = 1; i <= n; i++) {
				int y = n+1-i;
				if (i % 2==0)
					y--;
				for (int j = 1; j <= y; j++) {
					a[i][j] = x;
					x += 2;
				}
			}
		}
		else {
			int k = n / 2 + 1;
			int L = k, R = k;
			for (int i = 1; i <= n; i++) {
				for (int j = L; j <= R; j++) {
					a[i][j] = x;
					x += 2;
				}
				if (i < k) {
					L--;
					R++;
				}
				else {
					L++;
					R--;
				}
			}
		}
		x = 2;
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				if (a[i][j]==0) {
					a[i][j] = x;
					x += 2;
				}
			}
		}
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				System.out.print(a[i][j]+" ");
			}
			System.out.println();
		}
		pw.close();
	}
	private static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}
	private static long nextLong() throws IOException {
		return Long.parseLong(next());
	}
	private static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}
	private static String next() throws IOException {
		while (st==null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
}