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:
import random
storona=int(input())
mas = list(map(int, input().split(' ') ))
def get_slovar(mas):
    sl={}
    for i in mas:
        if i not in sl:
            sl[i]=1
        else:
            sl[i]+=1
    return(sl)
def chet(sl,storona):
    sl_strok={}
    for i in sl.values():
        if i%4!=0:
            return(False)
    for i in range(1,storona+1):
        sl_strok[i]=[]
    for i in range(1,storona//2+1):
        for g in range(1,storona//2+1):
           a = random.sample(sl.keys(),1)[0]
           #print(a, "добавочный элемент")
           if sl[a]==4:
               del sl[a]
           else:
               sl[a]=sl[a]-4
           sl_strok[i]=[a]+sl_strok[i]+[a]
           #print(sl_strok[i],"верхняя сторона")
           sl_strok[storona-i+1]=[a]+sl_strok[storona-i+1]+[a]
          # print(sl_strok[storona-i+1],"нижняя сторона")
    return(sl_strok)
def nechet(mas,storona):
     temp1 = 0
     krest=[]
     sl_strok = {}
     sl = get_slovar(mas)
     sl_dvoek = {}
     vert=[]
     goris=[]
     for key, value in sl.items():
        if value % 2 != 0:
            sl[key] -= 1
            central = key
            #print('centr:', central)
            #print(sl)
            break
     for key, value in sl.items():
        if value % 2 != 0:
          return False
        if value % 4 != 0:
          sl[key] -= 2
          sl_dvoek[key] = 2
     ostatok = (storona - 1) * 2 - sum(sl_dvoek.values())
     if ostatok < 0:
        return False
     if ostatok % 4 != 0:
        return False
     while ostatok > 0:
       a = random.sample(sl.keys(), 1)[0]
       if sl[a] >= 4:
          sl[a] -= 4
          if a not in sl_dvoek:
            sl_dvoek[a] = 4
          else:
            sl_dvoek[a] += 4
          ostatok -= 4
     sl = {key: value for key, value in sl.items() if value != 0}
     #print(sl,"sl")
     #print(sl_dvoek,"sl_dv")
     for i in range(storona-1):
         #print (i, sl, krest)
         a = random.sample(sl_dvoek.keys(), 1)[0]
         if sl_dvoek[a] == 2:
             del sl_dvoek[a]
         else:
             sl_dvoek[a] = sl_dvoek[a]-2
         krest = [a] + krest + [a]
     sl_strok = chet(sl, storona - 1)
     #print(sl_strok)
     #print(krest)
     goris=krest[:len(krest)//4]+[central]+krest[-len(krest)//4:]
     vert = krest[len(krest)//4:-len(krest)//4]
     vert=vert[:len(vert)//2]+[central]+vert[len(vert)//2:]
     #print(vert, "  ", goris)
     #ab=[1,2,3,4,5]
     #print(ab[1:], "  ", ab[:-1] )
     sl_strok[storona/2]=goris
     #print(sl_strok)
     for i in sorted(sl_strok.keys()):
         if i!=storona/2:
          sl_strok[i]=sl_strok[i][:len(sl_strok[i])//2]+[vert[temp1]]+sl_strok[i][len(sl_strok[i])//2:]
         temp1+=1
     return (sl_strok)
if storona%2==0:
    a=chet(get_slovar(mas),storona)
else:
    a=nechet(mas,storona)
if not a:
    print("NO")
    exit()
else:
    print("YES")
for i in sorted(a.keys()):
    print(*a[i])
#print(chet(get_slovar([1, 8, 8, 1, 2, 2, 2, 2, 2, 2 ,2 ,2, 1, 8, 8, 1]),4))
#print(nechet([1, 1, 1, 1, 1, 3, 3, 3, 3],3))