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:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.util.*;
import java.lang.*;
/**
 *
 * @author moh.mogh
 */
public class C1 {
    public static void main(String[] args) {
         Scanner scan=new Scanner(System.in);
         int n=scan.nextInt();
        print(n);
    }
    public static void print(int n)
    {
        int [][] mat=new int[n][n];
        for (int i = 0; i < mat.length; i++) {
            for (int j = 0; j < mat.length; j++) {
                mat[i][j]=0;
            }
        }
        mat[0][(n-1)/2]=1;
        int x=0,y=(n-1)/2;
        for(int i=2;i<=n*n;i++)
        {
            if(x==0 || y==n-1)
            {
                if(x==0 && y!=n-1)
                {
                    if(mat[n-1][y+1]==0)
                    {mat[n-1][y+1]=i;
                    x=n-1;
                    y=y+1;
                    }
                    else
                    {mat[1][y]=i;
                    x=1;
                    }
                }
                else
                {if(x!=0 && y==n-1)
                {
                    if(mat[x-1][0]==0)
                    {mat[x-1][0]=i;
                    x=x-1;
                    y=0;
                    }
                    else
                    {mat[x+1][y]=i;
                    x=x+1;
                    }
                }
                else{
                    if(mat[n-1][0]==0)
                    {mat[n-1][0]=i;
                    x=n-1;
                    y=0;
                    }
                    else
                    {mat[1][n-1]=i;
                    x=1;
                    y=n-1;
                    }
                    
                }
                }
            }
            else{
                if(mat[x-1][y+1]==0)
                {mat[x-1][y+1]=i;
                x=x-1;
                y=y+1;
                }
                else
                {mat[x+1][y]=i;
                x=x+1;
                }
            }
        }
        for (int i = 0; i < mat.length; i++) {
            for (int j = 0; j < mat.length; j++) {
                System.out.print(mat[i][j]+" ");
            }
            System.out.println();
        }
    }
}