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 PYTHON):

Solution:
import math
import string
x=input()
arr=[]
i=0
l = map(int,raw_input().split())
for item in l:
	arr.append(item)
arr.sort()
matrix=0
if (x==1):
	print("YES")
	print(arr[0])
else:
	if (x %2 ==0):
		k=1
		for i in range(1,x*x):
			if (arr[i]==arr[i-1]):
				k+=1
				if (k==4):
					k=0
			else:
				if (k==0):
					k=1
				else:
					matrix=1
					break
		if (matrix==1):
			print ("NO") 
		else:
			print ("YES")
			mat=[]
			matr=[]
			for i in range (x/2):
				for j in range(x/2):
					mat.append(arr[i*4*(x//2)+j*4])
				for j in range(x/2):
					mat.append(mat[x/2-1-j])
				matr.append(mat)
				mat=[]
					
			for i in range (x/2):
				sarr = [str(a) for a in matr[i]]
				print(" " . join(sarr))
				sarr=[]
			for i in range(x/2-1,-1,-1):
				sarr = [str(a) for a in matr[i]]
				print(" " . join(sarr))
				sarr=[]
	else:
		k=1
		k2=0
		arr2=[]
		k4=0
		mijloc=-1
		arr4=[]
		arr.append(-1)
		for i in range(1,x*x+1):
			if (arr[i]==arr[i-1]):
				k+=1
				if (k==4):
					k=0
					k4+=1
					arr4.append(arr[i])
			else:
				if (k==0):
					k=1
				else:
					if (k==2):
						k=1
						k2+=1
						arr2.append(arr[i-1])
					else:
						if ((k==1 or k==3) and mijloc==-1):
							mijloc=arr[i-1] 
							if(k==3):
								k2+=1
								arr2.append(arr[i-1])
							k=1
						else:
							matrix=1
							break
		if (matrix==1 or k4<(x/2)*(x/2)):
			print("NO")
		else:
			mat=[]
			matr=[]
			print("YES")
			while (k4>(x//2)*(x//2)) :
				arr2.append(arr4[k4-1])
				arr2.append(arr4[k4-1])
				del arr4[-1]
				k4-=1		
			for i in range(x//2):
				for j in range(x//2):
					mat.append(arr4[i*(x//2)+j])
				mat.append(arr2[i])
				for j in range(x//2):
					mat.append(mat[x//2-1-j])
				matr.append(mat)
				mat=[]
			for i in range (x//2):
				mat.append(arr2[x//2+i])
			mat.append(mijloc)
			for i in range (x//2):
				mat.append(mat[x//2-i-1])
			for i in range (x/2):
				sarr = [str(a) for a in matr[i]]
				print(" " . join(sarr))
				sarr=[]
			sarr = [str(a) for a in mat]
			print(" " . join(sarr))
			sarr=[]
			for i in range(x/2-1,-1,-1):
				sarr = [str(a) for a in matr[i]]
				print(" " . join(sarr))
				sarr=[]