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:


/* 
 ********************
 ********************
 ********************
 not solved yet 
 ********************
 ********************
 ********************
 */
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class Main {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {

        public void solve(int testNumber, InputReader input, PrintWriter out) {

            int n = input.nextInt();
            if (n == 1) {
                out.println(1);
            } else {
                for (int[] row : magicSquareOdd(n)) {
                    for (int x : row) {
                        out.print( x  +" ");
                    }
                    out.println();
                }
//            System.out.printf("\nMagic constant: %d ", (n * n + 1) * n / 2);
            }
        }

        public static int[][] magicSquareOdd(final int base) {
            if (base % 2 == 0 || base < 3) {
                throw new IllegalArgumentException("base must be odd and > 2");
            }

            int[][] grid = new int[base][base];
            int r = 0, number = 0;
            int size = base * base;

            int c = base / 2;
            while (number++ < size) {
                grid[r][c] = number;
                if (r == 0) {
                    if (c == base - 1) {
                        r++;
                    } else {
                        r = base - 1;
                        c++;
                    }
                } else {
                    if (c == base - 1) {
                        r--;
                        c = 0;
                    } else {
                        if (grid[r - 1][c + 1] == 0) {
                            r--;
                            c++;
                        } else {
                            r++;
                        }
                    }
                }
            }
            return grid;

        }
    }

    static class InputReader {

        public BufferedReader reader;
        public StringTokenizer tokenizer;

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

        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 int nextInt() {
            return Integer.parseInt(next());
        }

    }
}