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.
//package math_codet;

import java.io.*;
import java.util.*;
 
public class lets_do {
    FastReader in;
    PrintWriter out;
    Helper_class h;
    final long mod = 1000000007;
    final int MAXN = 100005;
    final int lgN = 20;
    final int INF = (int)1e12;
    public static void main(String[] args) throws java.lang.Exception{
        new lets_do().run();
    }
    void run() throws Exception{
        in=new FastReader(System.in);
        out = new PrintWriter(System.out);
        h = new Helper_class();
        int t = 1;
        while(t-->0)
            solve();
        out.flush();
        out.close();
    }
    void solve(){
        int n = h.ni();
        int[] arr1 = new int[n * n];
        int i = 0;
        int[] freq = new int[1001];
        for(i = 0; i < n * n; i++){
            arr1[i] = h.ni();
            freq[arr1[i]]++;
        }

        boolean ok = false;
        int[][] arr = new int[n][n];
        i = 0;
        int j = 0, k = 0, l = n - 1, m = 0, o = 0, p = 0, r = 0;
        int cnt = 0;
        while(cnt < n / 2){
            i = cnt; j = cnt; k = cnt; l = n - cnt - 1; m = n - cnt - 1; o = cnt; p = n - cnt - 1; r = n - cnt - 1;
            while(j <= l){
                int ind = -1;
                int reqd = 0;
                if(j == l)
                    reqd = 2;
                else
                    reqd = 4;
                //h.pn(reqd);
                int min = 1001;
                for(int yo = 1; yo <= 1000; yo++){
                    if(freq[yo] >= reqd && min > freq[yo]){
                        ind = yo;
                        min = freq[yo];
                    }
                }
                //h.pn(ind);
                if(ind == -1){
                    h.pn("NO");
                    return;
                }
                freq[ind] -= reqd;
                arr[i][j] = ind;
                arr[k][l] = ind;
                arr[m][o] = ind;
                arr[p][r] = ind;
                j++;
                l--;
                r--;
                o++;
                //for(int yo = 0; yo < n; yo++)
                	//h.pn(Arrays.toString(arr[yo]));
                //h.pn("");
            }
            i = cnt + 1; j = cnt; k = cnt + 1; l = n - cnt - 1; m = n - cnt - 2; o = cnt; p = n - cnt - 2; r = n - cnt - 1;
            while(i <= m){
                int ind = -1;
                int reqd = 0;
                if(i == m)
                    reqd = 2;
                else
                    reqd = 4;
                //h.pn(reqd);
                int min = 1001;
                for(int yo = 1; yo <= 1000; yo++){
                    if(freq[yo] >= reqd && min > freq[yo]){
                        ind = yo;
                        min = freq[yo];
                    }
                }
                if(ind == -1){
                    h.pn("NO");
                    return;
                }
                freq[ind] -= reqd;
                arr[i][j] = ind;
                arr[k][l] = ind;
                arr[m][o] = ind;
                arr[p][r] = ind;
                i++;
                m--;
                p--;
                k++;
                //for(int yo = 0; yo < n; yo++)
                	//h.pn(Arrays.toString(arr[yo]));
                //h.pn("");
            }
            cnt++;
            //h.pn(cnt);
        }
        int ind = -1;
        for(i = 1; i <= 1000; i++){
            if(freq[i] > 0){
                ind = i;
            }
        }
        for(i = 0; i < n; i++){
            for(j = 0; j < n; j++){
                if(arr[i][j] == 0)
                    arr[i][j] = ind;
            }
        }

        h.pn("YES");
        for(i = 0; i < n; i++){
            for(j = 0; j < n; j++)
                h.p(arr[i][j] +" ");
            h.pn("");
        }

    }   
    
    static final Comparator<Pair> com=new Comparator<Pair>(){
        public int compare(Pair a, Pair b){
            if(Integer.compare(a.y, b.y) != 0)
                return Integer.compare(a.y, b.y);
            else
                return Integer.compare(a.x, b.x);
        }
    };
    class Pair{
        int x;
        int y;
        Pair(int p, int q){
            y = p;
            x = q;
        }
    }
    class Edge{
        int u , v; long wt;
        Edge(int a, int b, long w){
            u = a;
            v = b;
            wt = w;
        }
        int other(int x) {
            return u ^ v ^ x;
        }
    }
    class Helper_class{
        long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
        int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
        int bitcount(long n){return (n==0)?0:(1+bitcount(n&(n-1)));}
        void p(Object o){out.print(o);}
        void pn(Object o){out.println(o);}
        void pni(Object o){out.println(o);out.flush();}
        String n(){return in.next();}
        String nln(){return in.nextLine();}
        int ni(){return Integer.parseInt(in.next());}
        long nl(){return Long.parseLong(in.next());}
        double nd(){return Double.parseDouble(in.next());}
 
        long mul(long a,long b){
            if(a>=mod)a%=mod;
            if(b>=mod)b%=mod;
            a*=b;
            if(a>=mod)a%=mod;
            return a;
        }
        long modPow(long a, long p){
            long o = 1;
            while(p>0){
                if((p&1)==1)o = mul(o,a);
                a = mul(a,a);
                p>>=1;
            }
            return o;
        }
        long add(long a, long b){
            if(a>=mod)a%=mod;
            if(b>=mod)b%=mod;
            if(b<0)b+=mod;
            a+=b;
            if(a>=mod)a-=mod;
            return a;
        }
    }
 
    class FastReader{
        private InputStream stream; 
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
 
        public FastReader(InputStream stream) {
            this.stream = stream;
        }
 
        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }
 
        public void skip(int x) {
            while (x-- > 0)
                read();
        }
 
        public int nextInt() {
            return Integer.parseInt(next());
        }
 
        public long nextLong() {
            return Long.parseLong(next());
        }
 
        public String nextString() {
            return next();
        }
 
        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
 
            return res.toString();
        }
 
        public String nextLine() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }
 
        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
 
        public boolean hasNext() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value != -1;
        }
 
        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    }
} 