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.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

public class C {
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        int n = ip(in.readLine());
        int a = n/2;
        for (int i=1; i<=n; i++) {
            for (int j=1; j<=n; j++) {
                int m = n*(mod((i+j-1+a), n))+(mod((i+2*j-2), n))+1;
                out.write(m+" ");
            }
            out.write("\n");
        }
        out.flush();
    }
    
    private static int mod (int m, int n) {
        if (m<0) {
            return m%n+n;
        }
        else {
            return m%n;
        }
    }
    
    private static int ip (String s) {
        int n = Integer.parseInt(s);
        return n;
    }
    
    private static long lp (String s) {
        long n = Long.parseLong(s);
        return n;
    }
    
    private static double dp (String s) {
        double n = Double.parseDouble(s);
        return n;
    }
    
    private static int[] ia (String s, int n) {
        String[] s1 = s.split(" ");
        int[] A = new int[n];
        for (int i=0; i<n; i++) {
            A[i] = Integer.parseInt(s1[i]);
        }
        return A;
    }
    
    private static long[] la (String s, int n) {
        String[] s1 = s.split(" ");
        long[] A = new long[n];
        for (int i=0; i<n; i++) {
            A[i] = Long.parseLong(s1[i]);
        }
        return A;
    }
    
    private static double[] da (String s, int n) {
        String[] s1 = s.split(" ");
        double[] A = new double[n];
        for (int i=0; i<n; i++) {
            A[i] = Double.parseDouble(s1[i]);
        }
        return A;
    }
}