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 que_a;

import java.io.*;
import java.util.*;
import java.math.*;

public class utkarsh {

    InputStream is;
    PrintWriter out;
    
    long mod = (long)(1e9 + 7), inf = (long)(3e18);
    
    void solve() {
        //SZ = sieve(); //SZ = 1000001;
        int n = ni();
        int d[] = new int[1001];
        for(int i = 0; i < n*n; i++)  d[ni()]++;
        int a[][] = new int[n][n];
        int u = 1;
        for(int i = 0; i < n/2; i++) {
            for(int j = 0; j < n/2; j++) {
                while(u <= 1000 && d[u] < 4)    u++;
                if(u > 1000) {
                    out.println("NO");  return;
                }
                a[i][j] = u;    a[i][n-j-1] = u;
                a[n-i-1][j] = u;    a[n-i-1][n-j-1] = u;
                d[u] -= 4;
            }
        }
        if(n%2 == 1) {
            u = 1;
            for(int i = 0; i < n/2; i++) {
                while(u <= 1000 && d[u] < 2)    u++;
                if(u > 1000) {
                    out.println("NO");  return;
                }
                a[i][n/2] = u;  a[n-i-1][n/2] = u;
                d[u] -= 2;
            }
            for(int i = 0; i < n/2; i++) {
                while(u <= 1000 && d[u] < 2)    u++;
                if(u > 1000) {
                    out.println("NO");  return;
                }
                a[n/2][i] = u;  a[n/2][n-i-1] = u;
                d[u] -= 2;
            }
            for(int i = 1; i <= 1000; i++) {
                if(d[i] > 0) {
                    a[n/2][n/2] = i;    break;
                }
            }
        }
        out.println("YES");
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) out.print(a[i][j] +" ");
            out.println();
        }
    }
    
    //--------- Extra Template -----------
    
    int P[], S[], SZ, NP = 15485900;
    boolean isP[];
    
    int sieve() {
        int i, j, n = NP; 
        isP = new boolean[n]; 
        S = new int[n];
        for(i = 3; i < n; i += 2) {
            isP[i] = true;
            S[i-1] = 2;
            S[i] = i;
        }
        isP[2] = true;
        S[1] = 1;   //(UD)
        for(i = 3; i * i <= n; i += 2) {
            if( !isP[i] )   continue;
            for(j = i * i; j < n; j += i) {
                isP[j] = false;
                if(S[j] == j)   S[j] = i;
            }
        }

        P = new int[n];
        P[0] = 2;
        j = 1;
        for(i = 3; i < n; i += 2) {
            if ( isP[i] )   P[j++] = i;
        }
        P = Arrays.copyOf(P, j);
        return j;
    }

    long mp(long b, long e, long mod) {
        b %= mod;
        long r = 1;
        while(e > 0) {
            if((e & 1) == 1) {
                r *= b; r %= mod;
            }
            b *= b; b %= mod;
            e >>= 1;
        }
        return r;
    }

    //---------- I/O Template ----------
    
    public static void main(String[] args) { new utkarsh().run(); }
    void run() { 
        is = System.in; 
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }
    
    byte input[] = new byte[1024];
    int len = 0, ptr = 0;
    
    int readByte() { 
        if(ptr >= len) { ptr = 0; 
            try { len = is.read(input); } 
            catch(IOException e) { throw new InputMismatchException(); } 
            if(len <= 0) { return -1; } 
        } return input[ptr++];
    }
    boolean isSpaceChar(int c) { return !( c >= 33 && c <= 126 ); }
    int skip() { 
        int b = readByte(); 
        while(b != -1 && isSpaceChar(b)) { b = readByte(); } 
        return b;
    }
    
    char nc() { return (char)skip(); }
    String ns() { 
        int b = skip(); 
        StringBuilder sb = new StringBuilder(); 
        while(!isSpaceChar(b)) { sb.appendCodePoint(b); b = readByte(); } 
        return sb.toString();
    }
    String nLine() { 
        int b = skip(); 
        StringBuilder sb = new StringBuilder(); 
        while( !(isSpaceChar(b) && b != ' ') ) { sb.appendCodePoint(b); b = readByte(); } 
        return sb.toString();
    }
    int ni() { 
        int n = 0, b = readByte(); 
        boolean minus = false; 
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); } 
        if(b == '-') { minus = true; b = readByte(); } 
        if(b == -1) { return -1; }  //no input 
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); } 
        return minus ? -n : n;
    }
    long nl() { 
        long n = 0L;    int b = readByte(); 
        boolean minus = false; 
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); } 
        if(b == '-') { minus = true; b = readByte(); } 
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); } 
        return minus ? -n : n;
    }

    double nd() { return Double.parseDouble(ns()); }
    float nf() { return Float.parseFloat(ns()); }
    int[] na(int n) { 
        int a[] = new int[n]; 
        for(int i = 0; i < n; i++) { a[i] = ni(); } 
        return a;
    }
    char[] ns(int n) { 
        char c[] = new char[n]; 
        int i, b = skip(); 
        for(i = 0; i < n; i++) { 
            if(isSpaceChar(b)) { break; } 
            c[i] = (char)b; b = readByte(); 
        } return i == n ? c : Arrays.copyOf(c,i);
    }
}