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:
def main():
  n=int(input())
  corner=[]
  middle=[]
  centre=[]
  arr=input().split()
  cat=[]
  for x in range(n*n):
    hold=int(arr[x])
    bo=False
    for y in range(len(cat)):
      if hold==cat[y][0]:
        cat[y][1]+=1
        bo=True
        break
    if not bo:
      cat.append([hold,1])

  #Determine if possible
  if n%2==1:
    for x in range(len(cat)):
      if cat[x][1]%2==1:
        centre.append(cat[x][0])
        cat[x][1]-=1
    if len(centre)!=1:
      print("NO")
      return 0
    for x in range(len(cat)):
      if cat[x][1]%4==2:
        middle.append(cat[x][0])
        cat[x][1]-=2
    if len(middle)>((n//2)*2):
      print("NO")
      return 0
  else:
    for x in range(len(cat)):
      if cat[x][1]%4!=0:
        print("NO")
        return 0
  print("YES")

  #sieve out the remaining values
  x=0
  while len(corner)<(n//2)*(n//2) and x<len(cat):
    if cat[x][1]>0:
      cat[x][1]-=4
      corner.append(cat[x][0])
    else:
      x+=1
  while x<len(cat):
    if cat[x][1]>0:
      cat[x][1]-=2
      middle.append(cat[x][0])
    else:
      x+=1

  #forming matrix
  arr=[[0 for x in range(n)] for y in range(n)]
  if n%2==1:
    arr[n//2][n//2]=centre[0]
    #print(middle)
    #print(len(corner))
    for x in range(n//2):
      arr[n//2][x]=middle[x]
      arr[n//2][n-1-x]=middle[x]
      arr[x][n//2]=middle[n-2-x]
      arr[n-1-x][n//2]=middle[n-2-x]
  x=0
  for y in range(n//2):
    for z in range(n//2):
      arr[y][z]=corner[x]
      arr[y][n-1-z]=corner[x]
      arr[n-1-y][z]=corner[x]
      arr[n-1-y][n-1-z]=corner[x]
      x+=1
  
  for x in range(n):
    for y in range(n-1):
      print(arr[x][y],end=" ")
    print(arr[x][n-1])
main()