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.util.Scanner;
import java.lang.*;

public class  Magic_Odd_Square{

	
    public static void main(String []args) {

       Scanner in = new Scanner( System.in ); 
         
       int n=in.nextInt();
       
       int s[][] = new int[n+1][n+1];
       
       for(int p=0; p<n; p++){
    	   for(int q=0; q<n; q++){
    		   s[p][q]=0;
    	   }
       }
       
       
       
       int i=1;
       
       int x=0;
       int y=n/2;
       
       s[x][y]=i;
       
       
       
       for(i=2; i<=n*n; i++){
    	   int dx=x;
    	   int dy=y;
    	   x=x-1;
    	   y=y+1;
    	   
    	   if ((x<0) & (y<n)){
    		   x=n-1;
    	   }
    	   if ((x>=0) & (y>=n)){
    		   y=0;
    	   }
    	   if ((x<0) & (y>=n)){
    		   x=x+2;
    		   y=y-1;
    	   }
    	   
    	   if(s[x][y]==0){
    		   s[x][y]=i;
    	   }
    	   else {
    		   x=dx+1;
    		   y=dy;
    		   s[x][y]=i;
    	   }
    	   
       }
       
      for(int p=0; p<n; p++){
    	   for(int q=0; q<n; q++){
    		   System.out.print(s[p][q]+" "); 
    	   }
    	   System.out.println(); 
       }
       
    }
    
}