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.util.Scanner;

/**
 * Created on 4/26/17 at 09:02 by Christopher Skalnik
 * for Data Structures under Ryan Ritz, Park Tudor
 * Project: EducationalRound; Module: ________; File: C
 * Made with: IntelliJ IDEA
 * Copyright (C) 2017 Christopher Skalnik
 * Code Sources:
 * References:
 */
public class C {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[][] arr = new int[n][n];

        int col = 0;
        int odd = 1;

        for (int c = 1; c <= n; c += 2) {
            int start = (n - c) / 2;
            for (int r = start; r < start + c; r ++) {
                arr[r][col] = odd;
                odd += 2;
            }
            col ++;
        }
        for (int c = n - 2; c >= 1; c -= 2) {
            int start = (n - c) / 2;
            for (int r = start; r < start + c; r ++) {
                arr[r][col] = odd;
                odd += 2;
            }
            col ++;
        }

        int even = 2;
        for (int r = 0; r < n; r ++) {
            for (int c = 0; c < n; c ++) {
                if (arr[r][c] == 0) {
                    arr[r][c] = even;
                    even += 2;
                }
            }
        }

        for (int r = 0; r < n; r ++) {
            for (int c = 0; c < n; c ++) {
                System.out.print(arr[r][c]);
                if (c != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
}