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.*;
public class magic_square_matrix
{
public static void main(String args[])throws Exception
{   
BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
int c=0,e=0,o,r=0,n=0;
n=Integer.parseInt(obj.readLine());
int a[][]=new int[n][n];  
c=n/2;
for(e=1;e<=n*n;e++)
{
a[r][c]=e; 
r=r-1;
c=c+1;
if(e%n==0) 
{
r=r+2;
c=c-1;
}
if(r<0)
r=n+r;  
if(c>=n)    
c=n-c;  
}   
for(int a1=0;a1<n;a1++)
{
for(int b1=0;b1<n;b1++)
{
System.out.print(a[a1][b1]+" ");
}
System.out.println();   
}
}  
}