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:
// CodeForces Educational Round 16 -- slowe

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;


public class C16 {
	
	public static void main(String[] args) throws Exception {
		FastScanner in = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		
		int n = in.nextInt(), n2 = n*n;
		int[][] sq = new int[n][n];
		int o = 1, e = 2;
		for(int i = 0; i < n; i++) {
			sq[i][n/2] = o;
			o+=2;
		}
		for(int i = 0; i < n; i++) {
			if(i != n/2) {
				sq[n/2][i] = o;
				o+=2;
			}
		}
		
		int oddsLeft = (n2+1)/2 - n - n + 1;
		oddsLeft/=4;
		int offset = 0;
		int pos = 0, half = n/2;
		while(oddsLeft --> 0) {
			int x = pos/half, y = pos%half;
			sq[x][y] = o;
			o+=2;
			sq[x][n-y-1] = o;
			o+=2;
			sq[n-x-1][y] = o;
			o+=2;
			sq[n-x-1][n-y-1] = o;
			o+=2;
			pos++;
		}
//		while(oddsLeft > 0) {
//			int s = (int) Math.sqrt(oddsLeft);
//			for(int i = 0; i < s; i++)
//				for(int j = 0; j < s; j++) {
//					sq[i+offset][j+offset] = o;
//					o+=2;
//				}
//			for(int i = 0; i < s; i++)
//				for(int j = 0; j < s; j++) {
//					sq[i+offset][n-j-offset-1] = o;
//					o+=2;
//				}
//			for(int i = 0; i < s; i++)
//				for(int j = 0; j < s; j++) {
//					sq[n-i-offset-1][j+offset] = o;
//					o+=2;
//				}
//			for(int i = 0; i < s; i++)
//				for(int j = 0; j < s; j++) {
//					sq[n-i-offset-1][n-j-offset-1] = o;
//					o+=2;
//				}
//			
//			oddsLeft -= s*s;
//			offset+=s;
//		}
		
		for(int i = 0; i < n2; i++) {
			if(sq[i/n][i%n]==0) {
				sq[i/n][i%n] = e;
				e+=2;
			}
			pw.print(sq[i/n][i%n]);
			if(i%n == n-1)
				pw.println();
			else pw.append(' ');
		}
		
		pw.flush();
		pw.close();
	}
	
	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer("");
		}
		
		String next() throws Exception {
			while(!st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		
		int nextInt() throws Exception {
			return Integer.parseInt(next());
		}
	}
}