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:
from collections import Counter
# from math import ceil
n = int(input())
a = list(map(int, input().split()))
ctr = Counter(a)

def mp(r,size):
	for i in range(size):
		for j in range(size):
			print(r[i][j],end = '')
			print(' ' if j < size-1 else '',end = '')
		print('')

if n % 2 == 0:
	b = True
	for i in range(1,max(a)+1):
		if ctr[i] % 4 != 0:
			b = False
			break
	print('yes' if b else 'no')
	if b:
		t = [[0 for i in range(n)] for j in range(n)]
		x = y = 0
		# print(ctr)
		for i in range(1,max(a)+1):
			while ctr[i] > 0:
				# print(x,y,i,ctr[i])
				t[x][y] = t[n-x-1][y] = t[x][n-y-1] = t[n-x-1][n-y-1] = i
				y += 0 if x < n//2-1 else 1
				x = x+1 if x < n//2-1 else 0
				ctr[i] -= 4
		mp(t,n)
		# print(ctr)
else:
	odd = two = four = temp = 0
	b = True
	for i in range(1,max(a)+1):
		if ctr[i] % 2 == 1:
			odd += 1
			temp = i
		else:
			if ctr[i] % 4 == 0 and ctr[i] != 0:
				four += 1
			elif ctr[i] % 4 == 2 and ctr[i] != 0:
				two += 1
				# print(i,1,ctr[i])
	if odd != 1:
		print('no')
		b = False
	else:
		if (ctr[temp]-1)%4 == 0:
			four += 1
		else:
			two += 1
			# print(i,2,ctr[i])
		print('yes' if (two <= n-1) or (n == 1) else 'no')
		b = True if (two <= n-1) or (n == 1) else False
	# print(two,four,odd)
	if b:
		t = [[0 for i in range(n)] for j in range(n)]
		t[n//2][n//2] = temp
		# print(t)
		# print(temp)
		ctr[temp] -= 1
		# print(ctr)
		x = y = 0
		tt = 0
		# print(ctr)
		for i in range(1,max(a)+1):
			while ctr[i] > 0 and (ctr[i] % 4 == 0 or ctr[i] > 4) and y < n//2:
				# print(x,y,i,ctr[i])
				t[x][y] = t[n-x-1][y] = t[x][n-y-1] = t[n-x-1][n-y-1] = i
				y += 0 if x < n//2-1 else 1
				x = x+1 if x < n//2-1 else 0
				ctr[i] -= 4
			while ctr[i] > 0:
				if tt < n//2:
					t[tt][n//2] = t[n-tt-1][n//2] = i
					ctr[i] -= 2
					tt += 1
				else:
					t[n//2][tt-n//2] = t[n//2][n-tt+n//2-1] = i
					ctr[i] -= 2
					tt += 1
		mp(t,n)
		# print(ctr)
# print(ctr)