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.math.BigInteger;
import java.util.*;
import java.io.*;

public class Main {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        FastReader() { 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;
        }
    }

  
    public static void main(String[] args) throws IOException {
        FastReader ip = new FastReader();
        OutputStream output = System.out;
        PrintWriter out = new PrintWriter(output);
        int n=ip.nextInt();
        int arr[][]=new int[n][n];
        int c=1;
        int colend=n-1;
        int colstart=1;
        for(int i=0;i<n/2;i++){
            for(int j=colstart;j<colend;j++){
                arr[i][j]=c;
                c=c+2;
            }
            colstart++;
            colend--;
        }
        for(int j=0;j<n;j++){
            arr[n/2][j]=c;
            c=c+2;
        }
        colstart--;
        colend++;
        for(int i=(n/2)+1;i<n;i++){
            for(int j=colstart;j<colend;j++){
                arr[i][j]=c;
                c=c+2;
            }
            colstart--;
            colend++;
        }
        c=2;
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                if(arr[i][j]==0){
                    arr[i][j]=c;
                    c=c+2;
                }
            }
        }
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                out.print(arr[i][j]+" ");
            }
            out.println();
        }
        out.close();
    }
}