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

public class C {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		PrintWriter out = new PrintWriter(System.out);
		int n = sc.nextInt();
		int arr[][] = new int[n][n];

		int col = n / 2;
		int odd = 1;
		for (int i = 0; i < n; ++i, odd += 2)
			arr[i][col] = odd;

		int row = n / 2;
		for (int i = 0; i < n; ++i) {
			if (arr[row][i] != 0)
				continue;
			arr[row][i] = odd;
			odd += 2;
		}
		int x = 0 ;
		while (odd < n * n) {
			int diagonal = 0 ;
			while (odd < n * n ) {
				if (arr[diagonal][diagonal + x] != 0 ) break;
				arr[diagonal][diagonal + x] = odd;
				odd += 2;
				arr[diagonal][n - diagonal - 1 - x] = odd;
				odd += 2;
				arr[n - diagonal - 1][diagonal + x] = odd;
				odd += 2;
				arr[n - diagonal - 1][n - diagonal - 1 - x] = odd;
				odd += 2;
				diagonal++;
			}
			x ++ ;
		}

		int even = 2;
		for (int i = 0; i < n; ++i)
			for (int j = 0; j < n; ++j)
				if (arr[i][j] == 0) {
					arr[i][j] = even;
					even += 2;
				}

		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < n; ++j)
				if (j == 0)
					sb.append(arr[i][j]);
				else
					sb.append(" " + arr[i][j]);
			sb.append("\n");
		}
		out.print(sb);
		out.flush();
		out.close();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

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

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

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}