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().strip())
entries = list(map(int, input().strip().split()))

# n = 5
# entries = []
# entries += [1]
# entries += [2]*2
# entries += [3]*2
# entries += [4]*2
# entries += [5]*2
# entries += [6]*(4*4)


if n == 1:
    print("Yes")
    print(entries[0])
    exit()

size_4_entries = (n//2) * (n//2)
size_2_entries = 2 * (n//2) * (n%2)
size_1_entries = n%2

counts = Counter(entries)
size_1 = []
size_2 = []
size_4 = []

digits = list(counts.keys())
dcounts = list(counts.values())

# Early exists
has_one = size_1_entries
for c in dcounts:
    if (c%2) == 1:
        has_one -= 1
        if has_one < 0:
            print("No")
            exit()

has_two = size_1_entries + size_2_entries
for c in dcounts:
    if (c%4) != 0:
        has_two -= 1
        if has_two < 0:
            print("No")
            exit()

def get_assign(s4, s2, s1, dcounts):
    if s4 == s2 == s1 == 0:
        res = dict()
        res["4"] = []
        res["2"] = []
        res["1"] = []
        yield res
        return

    if s4 != 0:
        for idx, count in enumerate(dcounts):
            if count >= 4:
                dcounts[idx] -= 4
                for sol in get_assign(s4-1, s2, s1, dcounts):
                    if sol is not None:
                        sol["4"].append(digits[idx])
                        yield sol
                dcounts[idx] += 4
    if s2 != 0:
        for idx, count in enumerate(dcounts):
            if count >= 2:
                dcounts[idx] -= 2
                for sol in get_assign(s4, s2-1, s1, dcounts):
                    if sol is not None:
                        sol["2"].append(digits[idx])
                        yield sol
                dcounts[idx] += 2
    if s1 != 0:
        for idx, count in enumerate(dcounts):
            if count >= 1:
                dcounts[idx] -= 1
                for sol in get_assign(s4, s2, s1-1, dcounts):
                    if sol is not None:
                        sol["1"].append(digits[idx])
                        yield sol
                dcounts[idx] += 1
    yield None

for res in get_assign(size_4_entries, size_2_entries, size_1_entries, dcounts):
    break

# from pprint import pprint
# pprint(memory)
if res is None:
    print("No")
    exit()
else:
    size_4 = res["4"]
    size_2 = res["2"]
    size_1 = res["1"]

print("Yes")
low = n//2
if (n%2)==0:
    high = n//2
else:
    high = n//2 + 1
for i in range(n):
    row = []
    for j in range(n):
        if i<low and j<low:
            row.append(size_4[j+n//2*i])
        elif i<low and j>=high:
            row.append(size_4[n-1-j+n//2*i])
        elif i>=high and j<low:
            row.append(size_4[j+n//2*(n-1-i)])
        elif i>=high and j>=high:
            row.append(size_4[n-1-j+n//2*(n-1-i)])
        elif (n%2)==1 and i==n//2:
            if j<low:
                row.append(size_2[j])
            elif j == n//2:
                row.append(size_1[0])
            else:
                row.append(size_2[n-1-j])
        elif (n%2)==1 and j==n//2:
            if i<low:
                row.append(size_2[n//2+i])
            else:
                row.append(size_2[n-1-(n//2+i)])
    print(" ".join(map(str, row)))