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


public class Cedu16 {
	public static void main(String[] args) {
		MyScanner scan = new MyScanner();
		PrintWriter out = new PrintWriter(System.out);
		
		int N = scan.nextInt();
		
		int[][] mat = new int[N][N];
		
		
		int r=0,c=0,idx=N;
		for(int i=N;i>1;i-=1){
			int x = (((idx+1)/2)%2==0)?1:0;
			idx-=2;
			int cStart = c;
			int rStart = r;
			for(int j=c;j<i;j++){
				mat[r][j]=x;
				c=j;
				x^=1;
			}r++;
			for(int j=r;j<i;j++){
				mat[j][c]=x;
				r=j;
				x^=1;
			}c--;
			for(int j=c;j>=cStart;j--){
				mat[r][j]=x;
				c=j;
				x^=1;
			}r--;
			for(int j=r;j>rStart;j--){
				mat[j][c]=x;
				r=j;
				x^=1;
			}c++;
		}
		int e = 2, o = 1;
		for(int i=0;i<N;i++){
			for(int j=0;j<N;j++){
				if(mat[i][j]%2==1){
					out.print(e+" ");e+=2;
				}else{
					out.print(o+" ");o+=2;
				}
				//out.print(mat[i][j]+" ");
			}out.println();
		}
		out.close();
	}
	private static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner() {br = new BufferedReader(new InputStreamReader(System.in));}
		String next(){
			while(st==null||!st.hasMoreElements()){
				try{st = new StringTokenizer(br.readLine());}
				catch(IOException e){e.printStackTrace();}
			}return st.nextToken();
		}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong(){return Long.parseLong(next());}
		double nextDouble(){return Double.parseDouble(next());}
	}
}