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:
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')


def solve():
    
    
    
    n=ii()
    a=li()
    x=[[0]*n for i in range(n)]
    a.sort()
    m=dd(int)
    for i in a:
        m[i]+=1
    if n%2==0:
        r,c=0,0
        for i in m.keys():
            if m[i]%4:
                print('NO')
                exit(0)
            while(m[i]):
                x[r][c],x[r][n-c-1],x[n-r-1][c],x[n-r-1][n-c-1]=i,i,i,i
                m[i]-=4
                c+=1
                if(c==n//2):
                    r+=1
                    c=0
        print("YES")
        for i in range(n):
            print(*x[i])
    else:
        r,c=0,0
        for i in m.keys():
            while(m[i]>=4):
                if(r==n//2):
                    break
                x[r][c],x[r][n-c-1],x[n-r-1][c],x[n-r-1][n-c-1]=i,i,i,i
                m[i]-=4
                c+=1
                if(c==n//2):
                    r+=1
                    c=0
        r,c=0,0
        for i in m.keys():
            while(m[i]>=2):
                if(r==n//2):
                    break
                x[r][n//2],x[n-r-1][n//2]=i,i
                m[i]-=2
                r+=1
        for i in m.keys():
            while(m[i]>=2):
                if(c==n//2):
                    break
                x[n//2][c],x[n//2][n-c-1]=i,i
                m[i]-=2
                c+=1

        for i in m.keys():
            if m[i]>0:
                x[n//2][n//2]=i
        
        for i in x:
            if 0 in i:
                print("NO")
                exit(0)
        print("YES")
        for i in range(n):
            print(*x[i])
    
    
    
    
    
    
    
    
    
    
    
    
    
        
        
        
        
if __name__ =="__main__":
    solve()