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 verify():
    if hwmany*2 != n*n+1:
        print "hwmy = %d" % hwmany
        return False
    for row in rs:
        if sum(row)%2 == 0:
            print "row failed"
            return False
    for i in xrange(n):
        if sum([r[i] for r in rs])%2 == 0:
            print "col failed"
            return False
    if sum([r[i] for i, r in enumerate(rs)])%2 == 0:
        print "main diag fail"
        return False
    if sum([r[n-1-i] for i, r in enumerate(rs)])%2 == 0:
        print "other diag fail"
        return False
    return True

n = int(raw_input())

def mnh(a, b, x, y):
    return abs(a-x) + abs(b-y)

rs = []
hwmany = 0
for i in xrange(n):
    rs.append([])
    for j in xrange(n):
        a = 0
        if mnh(i, j, 0, 0) >= n/2 and mnh(i, j, 0, n-1) >= n/2 and mnh(i, j, n-1, 0) >= n/2 and mnh(i, j, n-1, n-1) >= n/2:
            a = 1
            hwmany += 1
        rs[-1].append(a)

if not verify():
    print "Failed!"
else:
    e = 2
    o = 1
    for r in rs:
        l = []
        for a in r:
            if a:
                l.append(str(o))
                o += 2
            else:
                l.append(str(e))
                e += 2
        print " ".join(l)