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 PYTHON3):

Solution:
UNFILLED_CELL = 0

def get_blank_matrix(n):

	matrix = []

	for i in range(n):

		row = []

		for j in range(n):

			row.append(UNFILLED_CELL)

		matrix.append(row)

	return matrix


def generate_matrix(n):

	matrix = get_blank_matrix(n)
	x = n//2
	y = 0
	max_number = n**2
	current_number = 1

	while current_number != max_number + 1:

		matrix[y][x] = current_number

		next_x = x + 1
		next_y = y - 1

		if next_y == -1:

			next_y = n - 1

		if next_x == n:

			next_x = 0

		if matrix[next_y][next_x] != UNFILLED_CELL:

			next_y = y + 1
			next_x = x

		x = next_x
		y = next_y
		current_number += 1

	return matrix


def print_matrix(matrix):

	delimeter = " "

	for row in matrix:

		print(delimeter.join(map(str, row)))


def main():

	n = int(input())
	matrix = generate_matrix(n)
	print_matrix(matrix)

main()