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.*;
import java.util.*;
public class C1 {
	public static void main(String[]args)throws Throwable{
		MyScanner sc=new MyScanner();
		int n=sc.nextInt();
		int odd=1,even=2;
		int cntOdd=(n*n+1)/2;
		int[][]a=new int[n][n];
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++){
				if(i==n/2 || j==n/2){
					a[i][j]=odd;
					odd+=2;
					cntOdd--;
				}
			}
		int start=0;
		while(cntOdd>0){
			int x=start/(n/2);
			int y=start%(n/2);
			a[x][y]=odd;
			a[x][n-1-y]=odd+2;
			a[n-1-x][y]=odd+4;
			a[n-1-x][n-1-y]=odd+6;
			odd+=8;
			cntOdd-=4;
			start++;
		}
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++){
				if(a[i][j]==0){
					a[i][j]=even;
					even+=2;
				}
			}
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				System.out.print(a[i][j]+" ");
			}
			System.out.println();
		}
			
	}

	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());
	      }
	 
	      String nextLine(){
	          String str = "";
		  try {
		     str = br.readLine();
		  } catch (IOException e) {
		     e.printStackTrace();
		  }
		  return str;
	      }

	   }
}