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:
n=int(input())
mxc=((n*n+1)//2-(2*n-1))//4
m=[]
for i in range(n):
	l=[0]*n
	m.append(l)
odd=1
i=n//2
j=0
while(j<n):
	m[i][j]=odd
	j+=1
	odd+=2
j=0
while(j<n):
	if i==j:
		j+=1
		continue
	m[j][i]=odd
	j+=1
	odd+=2
i=0
j=0
c=0
while(c<mxc):
	c+=1
	m[i][j]=odd
	odd+=2
	m[i][n-1-j]=odd
	odd+=2
	m[n-1-i][j]=odd
	odd+=2
	m[n-i-1][n-1-j]=odd
	odd+=2
	j+=1
	if j==n//2:
		j=0
		i+=1
even=2
for i in range(n):
	for j in range(n):
		if m[i][j]==0:
			m[i][j]=even
			even+=2
for i in range(n):
	for j in range(n):
		print(m[i][j],end=" ")
	print()