Problem: Let's call some square matrix with integer values in its cells palindromic if it doesn't change after the order of rows is reversed and it doesn't change after the order of columns is reversed.

For example, the following matrices are palindromic:

<image>

The following matrices are not palindromic because they change after the order of rows is reversed:

<image>

The following matrices are not palindromic because they change after the order of columns is reversed:

<image>

You are given n^2 integers. Put them into a matrix of n rows and n columns so that each number is used exactly once, each cell contains exactly one number and the resulting matrix is palindromic. If there are multiple answers, print any. If there is no solution, print "NO".

Input

The first line contains one integer n (1 ≤ n ≤ 20).

The second line contains n^2 integers a_1, a_2, ..., a_{n^2} (1 ≤ a_i ≤ 1000) — the numbers to put into a matrix of n rows and n columns.

Output

If it is possible to put all of the n^2 numbers into a matrix of n rows and n columns so that each number is used exactly once, each cell contains exactly one number and the resulting matrix is palindromic, then print "YES". Then print n lines with n space-separated numbers — the resulting matrix.

If it's impossible to construct any matrix, then print "NO".

You can print each letter in any case (upper or lower). For example, "YeS", "no" and "yES" are all acceptable.

Examples

Input


4
1 8 8 1 2 2 2 2 2 2 2 2 1 8 8 1


Output


YES
1 2 2 1
8 2 2 8
8 2 2 8
1 2 2 1


Input


3
1 1 1 1 1 3 3 3 3


Output


YES
1 3 1
3 1 3
1 3 1


Input


4
1 2 1 9 8 4 3 8 8 3 4 8 9 2 1 1


Output


NO


Input


1
10


Output


YES
10 

Note

Note that there exist multiple answers for the first two examples.

Solution (in PYTHON3):

Solution:
from collections import Counter

n = int(input())
A = [int(i) for i in input().split()]

C = Counter(A)
B = [[] for i in range(5)]

Q = [[0] * 5 for i in range(21)]
Q[1][1] = 1

for i in range(3, 21, 2):
    Q[i][1] = 1
    Q[i][2] = Q[i-2][2] + 2
    Q[i][4] = Q[i-2][4] + (i - 2)

for i in range(2, 21, 2):
    Q[i][4] = (i // 2) ** 2

P = Q[n]

if n % 2 == 0:
    #4を埋める
    for k, v in C.items():
        if v % 4 != 0:
            print('NO')
            exit()
        B[4] += [k] * (v // 4)

    #出力
    print('YES')
    m = n // 2
    D = dict()
    for i in range(n):
        a = i if i < m else n - i - 1
        ans = []
        for j in range(n):
            b = j if j < m else n - j - 1
            if not (a, b) in D:
                D[a, b] = B[4].pop()
            ans.append(D[a, b])
        print(*ans)

else:
    #奇数が1つ
    for k, v, in C.items():
        if v % 2 == 1:
            C[k] -= 1
            P[1] -= 1
            B[1].append(k)

    #4を埋める
    for k, v in C.items():
        if P[4] == 0:
            break
        t = min(P[4], v // 4)
        C[k] -= 4 * t
        P[4] -= t
        B[4] += [k] * t
        

    #2を埋める
    for k, v in C.items():
        t = v // 2
        B[2] += [k] * t
        P[2] -= t
        C[k] -= 2 * t
    
    if P[1] != 0 or P[4] != 0 or P[2] != 0:
        print('NO')
        exit()
    #出力
    print('YES')
    m = n // 2
    D = dict()
    for i in range(n):
        ans = []
        for j in range(n):
            if i == m and j == m:
                ans.append(B[1][0])
            elif i == m:
                k = j if j < m else n - j - 1
                k += Q[n][2] // 2
                ans.append(B[2][k])
            elif j == m:
                k = i if i < m else n - i - 1
                ans.append(B[2][k+m])
            else:
                a, b = abs(i-m), abs(j-m)
                if not (a, b) in D:
                    D[a, b] = B[4].pop()
                ans.append(D[a, b])
        print(*ans)