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:
import java.util.*;

    
/*1 2 3 2 1
5 9 4 9 5
6 4 8 4 6
5 9 4 9 5
1 2 3 2 1*/
public class Dep{

	public static void main(String args[]){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int a[][]=new int[n][n];
		int r=0;
		int c=0;
		int p=0;
		Map<Integer,Integer> map = new HashMap();
		
		
		
		
		for(int i=0;i<n*n;i++){
			int x = s.nextInt();
			if(!map.containsKey(x)){
				map.put(x,1);
			}
			else{
			map.put(x,1 + map.get(x));
			}
		}
		
		
		if(n%2==0){
			for(Map.Entry<Integer,Integer> val:map.entrySet()){
				if(val.getValue()%4!=0){
					System.out.println("No");
					return;
				}
				else{
					
					int b=val.getValue()/4;
					p+=b;
					for(int i=0;i<b;i++){
						a[r][c]=val.getKey();
						a[n-r-1][c]=val.getKey();
						a[r][n-c-1]=val.getKey();
						a[n-r-1][n-c-1]=val.getKey();
						
						c++;
						if(c==n/2){
							r++;
							c=0;
						}
					}
				}
			}
			
		}
		else{
			int q=0;
			int z=0;
			int w=0;
			int d=0;
			
			for(Map.Entry<Integer,Integer> val:map.entrySet()){
				if(val.getValue()%2!=0){
					q++;
					a[n/2][n/2]=val.getKey();
					if(q==2){
						System.out.println("No");
						return;
					}
				}
				else{
					z++;
				}	
			
				int y=n/2;	
				if (z>y*y+2*y){
					System.out.println("No");
					return;
				}
				
				int b=val.getValue()/4;
				p+=b;
				for(int i=0;i<b;i++){
					if(r>=n/2){
						for(int k=0;k<2;k++){
							
							if(w<(int)(n/2)){
								a[n/2][w]=val.getKey();
								a[n/2][n-1-w]=val.getKey();
								
								w++;
							}
							else{
								a[w-n/2][n/2]=val.getKey();
								
								a[n-1-w+n/2][n/2]=val.getKey();
							//System.out.println(n-1-(w-n/2) +" "+n/2 + " "+val.getKey());
								w++;
							}
							
						}
					}
					else{
						
						a[r][c]=val.getKey();
						a[n-r-1][c]=val.getKey();
						a[r][n-c-1]=val.getKey();
						a[n-r-1][n-c-1]=val.getKey();
					}	
					c++;
					
					if(c==n/2) {
						r++;
						c=0;
					}
				}
				d=val.getValue()%4;
				if(d%2!=0){
					d=d-1;
				}
				
				if(d!=0){
					
					if(w<n/2){
						a[n/2][w]=val.getKey();
						a[n/2][n-1-w]=val.getKey();
						
						w++;
					}
					else{
						a[w-n/2][n/2]=val.getKey();
						
						a[n-1-w+n/2][n/2]=val.getKey();
						w++;
					}
				}
					
			}
			
		}
		if(p<(int)(n/2)*(int)(n/2)){
			System.out.println("No");
			return;
		}
		
		System.out.println("Yes");
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				System.out.print(a[i][j]+" ");
			}
			System.out.println("");
		}
		
		
		
	}
}