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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jenish
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CMagicOddSquare solver = new CMagicOddSquare();
        solver.solve(1, in, out);
        out.close();
    }

    static class CMagicOddSquare {
        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            int arr[][] = new int[n + 1][n + 1];
            for (int a[] : arr) Arrays.fill(a, -1);
            long odd = (n * n) / 2 + 1;
            int p = 1;
            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= n; j++) {
                    if (i == n / 2 + 1 || j == n / 2 + 1) {
                        arr[i][j] = p;
                        p += 2;
                    }
                }
            }


            long remain = (odd - n - (n - 1)) / 4;


            for (int i = 1; i <= n / 2; i++) {
                for (int j = 1; j <= n / 2; j++) {
                    if (remain > 0) {
                        arr[i][j] = p;
                        p += 2;

                        arr[i][n - j + 1] = p;
                        p += 2;


                        arr[n - i + 1][j] = p;
                        p += 2;

                        arr[n - i + 1][n - j + 1] = p;
                        p += 2;


                        remain--;
                    }
                }
            }

            p = 2;
            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= n; j++) {
                    if (arr[i][j] == -1) {
                        arr[i][j] = p;
                        p += 2;
                    }
                }
            }


            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= n; j++) {
                    out.print(arr[i][j] + " ");
                }
                out.println();
            }


            for (int i = 1; i <= n; i++) {
                long sum = 0;
                for (int j = 1; j <= n; j++) {
                    sum += arr[i][j];
                }
                if (sum % 2 == 0) throw new RuntimeException("ERER");
            }

            for (int j = 1; j <= n; j++) {
                long sum = 0;
                for (int i = 1; i <= n; i++) {
                    sum += arr[i][j];
                }
                if (sum % 2 == 0) throw new RuntimeException("ERER");
            }
            long sum = 0;
            for (int i = 1; i <= n; i++) {
                sum += arr[i][i];
            }
            if (sum % 2 == 0) throw new RuntimeException("ERER");


            sum = 0;
            for (int i = 1; i <= n; i++) {
                sum += arr[i][n - i + 1];
            }
            if (sum % 2 == 0) throw new RuntimeException("ERER");


        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int INDEX;
        private BufferedInputStream in;
        private int TOTAL;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (INDEX >= TOTAL) {
                INDEX = 0;
                try {
                    TOTAL = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (TOTAL <= 0) return -1;
            }
            return buf[INDEX++];
        }

        public int scanInt() {
            int I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}