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

Solution:
//package ;
import java.io.*;
import java.util.*;

public class C {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter pw = new PrintWriter(System.out);
		int n=sc.nextInt();
		int[]a=new int[1001];
		for(int i=0;i<n*n;i++)a[sc.nextInt()]++;
		Queue<Integer>[]idx=new LinkedList[1001];
		idx[4]=new LinkedList<Integer>();
		idx[2]=new LinkedList<Integer>();
		idx[1]=new LinkedList<Integer>();
		for(int i=0;i<=1000;i++)
		{
			int val=a[i];
			int x=val;
			while(x>3)
			{
				idx[4].add(i);
				x-=4;
			}
			if(x>=2)
			{
				idx[2].add(i);
				x-=2;
			}
			if(x>0)
				idx[1].add(i);
		}
//		System.out.println(idx[4]);
//		System.out.println(idx[2]);
//		System.out.println(idx[1]);
		int sol[][]=new int[n][n];
		if(n%2==1)
		{
			if(idx[1].isEmpty())
			{
				System.out.println("NO");
				return;
			}
			sol[n/2][n/2]=idx[1].poll();
			for(int j=0;j<n/2;j++)
			{
				if(idx[2].size()>=2)
				{
					int get=idx[2].poll();
					sol[n/2][j]=get;
					sol[n/2][n-j-1]=get;
					
					get=idx[2].poll();
					sol[j][n/2]=get;
					sol[n-j-1][n/2]=get;
				}
				else if(!idx[4].isEmpty())
				{
					int get=idx[4].poll();
					sol[n/2][j]=get;
					sol[n/2][n-j-1]=get;
					sol[j][n/2]=get;
					sol[n-j-1][n/2]=get;
				}
				else
				{
					System.out.println("NO");
					return;
				}

			}
		}
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				if(sol[i][j]!=0)continue;
				int revcol=n-j-1;
				int revrow=n-i-1;
				if(!idx[4].isEmpty())
				{
					int get=idx[4].poll();
					sol[i][j]=get;
					sol[revrow][revcol]=get;
					sol[i][revcol]=get;
					sol[revrow][j]=get;
				}
				else
				{
					System.out.println("NO");
					return;
				}
			}
		}
		pw.println("YES");
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				pw.print(sol[i][j]+" ");
			}
			pw.println();
		}
		pw.close();
	}
	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}

		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

		boolean hasnext() throws IOException {
			return br.ready();
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public Integer[] nextIntegerArray(int n) throws IOException {
			Integer[] a = new Integer[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		char[] nextCharArray() throws IOException {
			return br.readLine().toCharArray();
		}

		public double[] nextDoubleArray(int n) throws IOException {
			double[] ans = new double[n];
			for (int i = 0; i < n; i++)
				ans[i] = nextDouble();
			return ans;
		}

	}
}