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.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;

public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder out = new StringBuilder();
        StringTokenizer tk;
        
        int n = parseInt(in.readLine());
        int odd=1,even=2;
        
        int [][] a = new int[n][n];
        for(int i=0; i<n; i++)
            Arrays.fill(a[i], -1);
        
        int x = n/2;
        
        for(int i=0; i<=x; i++)
            for(int j=x-i; j<=x+i; j++) {
                a[i][j] = odd;
                odd += 2;
            }
        for(int i=x+1,y=x-1; i<n; i++,y--)
            for(int j=x-y; j<=x+y; j++) {
                a[i][j] = odd;
                odd += 2;
            }
        
        for(int i=0; i<n; i++)
            for(int j=0; j<n; j++)
                if(a[i][j]==-1) {
                    a[i][j] = even;
                    even += 2;
                }
        
        for(int i=0; i<n; i++) {
            out.append(a[i][0]);
            for(int j=1; j<n; j++)
                out.append(" ").append(a[i][j]);
            out.append("\n");
        }
        
        System.out.print(out);
    }

}