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.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;

public class Solution {

    public static void main(String args[]) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Problem problem = new Problem();
//        int testcase = Integer.parseInt(in.scanInput());
//        for (int i = 1; i <= testcase; i++)
//            problem.solve(i, in, out);
        problem.solve(1, in, out);
        out.close();
    }

}

class Problem {

    public void solve(int testcase, InputReader in, PrintWriter out) {
        int N = Integer.parseInt(in.scanInput());
        int matrix[][] = new int[N][N];
        buildMatrix(matrix, N);
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                out.print(matrix[i][j] + " ");
            }
            out.println();
        }
    }

    private void buildMatrix(int[][] matrix, int N) {
        int count = 1;
        int i = 0;
        int j = N / 2;
        while (count <= N*N) {
            matrix[i][j] = count++;
            i = (i + N - 1) % N;
            j = (j + 1) % N;
            if (matrix[i][j] != 0) {
                i = (i + 2) % N;
                j = (j + N - 1) % N;
            }
        }
    }

}

class InputReader {

    private BufferedReader mReader;
    private StringTokenizer mTokenizer;

    public InputReader(InputStream stream) {
        mReader = new BufferedReader(new InputStreamReader(stream));
        mTokenizer = null;
    }

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

}