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:
'''input
5
1 1 1 1 1 1 1 1 3 3 3 3 5 5 7 7 6 6 6 6 7 7 7 7 1
'''
import sys
from collections import defaultdict as dd
from itertools import  permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
import heapq
mod=10**9+7

def ri(flag=0):
	if flag==0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())


n=ri(1)
a=ri()
check=dd(int)

for i in a:
	check[i]+=1

take=[]
two=[]
one=[]
done=0
for i in check:
	if check[i]%4==0:
		for j  in range(check[i]//4):
			take.append(i)
	elif check[i]%2==0:
		for j in range(check[i]//4):
			take.append(i)
		two.append(i)
	elif check[i]%2==1:
		if check[i]>4:
			keep=i
			cooo=check[i]//4
			if check[i]%4==3:
				two.append(i)
			one.append(i)
		elif check[i]>2:
			two.append(i)
			one.append(i)
		else:
			one.append(i)
	else:
		print("NO")
		done=1

try:
	for i in range(cooo):
		take.append(keep)
except:
	pass

if n%2==0 and done==0:
	if len(two)==0 and len(one)==0:
		vis=[[0 for i in range(n)] for j in range(n)]
		for i in range(n):
			for j in range(n):
				if vis[i][j]==0:
					if take:
						k=take.pop(0)
						vis[i][j]=k
						vis[n-i-1][j]=k
						vis[i][n-j-1]=k
						vis[n-i-1][n-j-1]=k
		done=1
		for i in range(n):
			for j in range(n):
				if vis[i][j]==0:
					done=0
		if done:
			print("YES")
			for i in vis:
				print(*i)
		else:
			print("NO")
	else:
		print("NO")
if n%2==1 and done==0:
	if len(one)==1:
		vis=[[0 for i in range(n)] for j in range(n)]
		for i in range(n//2):
			for j in range(n//2):
				if vis[i][j]==0 and take:
					k=take.pop(0)
					vis[i][j]=k
					vis[n-i-1][j]=k
					vis[i][n-j-1]=k
					vis[n-i-1][n-j-1]=k
		x=0
		y=n//2
		x1=n//2
		y1=n//2
		#print(vis)
		for i in range(n//2+1):
			for j in range(n//2+1):
				if vis[i][j]==0 and take:
					#print(i,j,n-i-1,n-j-1)
					k=take.pop(0)
					vis[i][j]=k
					vis[j][i]=k
					vis[n-j-1][n-i-1]=k
					vis[n-i-1][n-j-1]=k

		for i in range(n//2):
			x=n//2
			if vis[i][x]==0:
				if two:
					k=two.pop(0)
					vis[i][x]=k
					vis[n-i-1][x]=k
		for i in range(n//2):
			x=n//2
			if vis[x][i]==0:
				if two:
					k=two.pop(0)
					vis[x][i]=k
					vis[x][n-i-1]=k
		vis[n//2][n//2]=one[0]
		done=1
		for i in range(n):
			for j in range(n):
				if vis[i][j]==0:
					done=0
		if done:
			print("YES")
			for i in vis:
				print(*i)
		else:
			print("NO")
	else:
		print("NO")