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.StringTokenizer;

public class TaskC {

    private static final boolean TEST_CASES = false;

    void solve(int testCaseNo, InputReader in, PrintWriter out) {
        final int n = in.nextInt();
        final int[][] mat = new int[n + 1][n + 1];
        int mid = (n + 1) / 2;
        int rest = ((n - 3) * (n - 1)) / 8;
        int nextOdd = 1, nextEven = 2;
        for (int i = 1; i < mid; i++) {
            for (int j = 1; j < mid; j++) {
                if (rest <= 0) break;
                rest--;
                mat[i][j] = nextOdd;
                nextOdd += 2;
                mat[i][n - j + 1] = nextOdd;
                nextOdd += 2;
                mat[n - i + 1][j] = nextOdd;
                nextOdd += 2;
                mat[n - i + 1][n - j + 1] = nextOdd;
                nextOdd += 2;
            }
        }

        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                if (mat[i][j] > 0) continue;
                if (i == mid || j == mid) {
                    mat[i][j] = nextOdd;
                    nextOdd += 2;
                } else {
                    mat[i][j] = nextEven;
                    nextEven += 2;
                }
            }
        }

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


    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        /**
         * @return null if end of stream
         */
        public String readLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int testCases = TEST_CASES ? in.nextInt() : 1;

        TaskC solver = new TaskC();
        for (int testCase = 0; testCase < testCases; testCase++) {
            solver.solve(testCase, in, out);
        }
        out.flush();
        out.close();
    }
}