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

Solution:
def magic(n):
	if n ==1:
		print 1
	else:
		grid = [ [ 0 for c in xrange(n) ] for r in xrange(n) ]
		row, col = 0, n/2
		n2, v = n*n, 1;
		r, c = 0, 0
		grid[row][col] = v
		while v != n2:
			v += 1
			if (row-1) >= 0:
			    r = row-1
			else:
			    r = n-1
			if (col+1) < n:
			    c = col+1
			else: c = 0
			if grid[r][c]:
				if (row+1) < n:
					r = row+1
					if grid[r][col]:
					    break
					c = col
			grid[r][c] = v
			row = r
			col = c
		for r in xrange(n):
			for c in xrange(n):
				print grid[r][c],
			print


n=int(raw_input())
magic(n)