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

public class Task {

    public static void main(String[] args) throws IOException {

        new Task().go();
    }

    PrintWriter out;
    Reader in;
    BufferedReader br;

    Task() throws IOException {

        try {

            //br = new BufferedReader( new FileReader("input.txt") );
            in = new Reader("input.txt");
            out = new PrintWriter( new BufferedWriter(new FileWriter("output.txt")) );
        }
        catch (Exception e) {

            //br = new BufferedReader( new InputStreamReader( System.in ) );
            in = new Reader();
            out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out)) );
        }
    }

    void go() throws IOException {

        int t = 1;
        while (t > 0) {
            solve();
            //out.println();
            t--;
        }

        out.flush();
        out.close();
    }

    int inf = 2000000000;
    int mod = 1000000007;
    double eps = 0.000000001;

    int n;
    int m;

    int[] a;
    ArrayList<Integer>[] g;
    void solve() throws IOException {
        int n = in.nextInt();
        int[] cnt = new int[1010];
        for (int i = 0; i < n * n; i++) {
            int x = in.nextInt();
            cnt[x]++;
        }

        int[][] a = new int[n][n];
        int cur = 1;
        for (int i = 0; i < n / 2; i++)
            for (int j = 0; j < n / 2; j++) {
                if (a[i][j] == 0) {

                    while (cur < cnt.length && cnt[cur] < 4) {
                        cur++;
                    }

                    if (cur == cnt.length) {
                        //System.err.println(i + " " + j);
                        out.print("NO");
                        return;
                    }
                    cnt[cur] -= 4;
                    a[i][j] = cur;
                    a[n - i - 1][j] = cur;
                    a[i][n - j - 1] = cur;
                    a[n - i - 1][n - j - 1] = cur;
                }
            }

            if (n % 2 == 1) {
                cur = 1;
                for (int i = 0; i < n / 2; i++) {
                    while (cur < cnt.length && cnt[cur] < 2) {
                        cur++;
                    }
                    if (cur == cnt.length) {
                        out.print("NO");
                        return;
                    }
                    cnt[cur] -= 2;
                    a[i][n / 2] = cur;
                    a[n - i - 1][n / 2] = cur;
                }

                for (int i = 0; i < n / 2; i++) {
                    while (cur < cnt.length && cnt[cur] < 2) {
                        cur++;
                    }
                    if (cur == cnt.length) {
                        out.print("NO");
                        return;
                    }
                    cnt[cur] -= 2;
                    a[n / 2][i] = cur;
                    a[n / 2][n - i - 1] = cur;
                }
            }

            for (int i = 0; i < cnt.length; i++)
                if (cnt[i] == 1)
                    a[n / 2][n / 2] = i;

            out.println("Yes");
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++)
                    out.print(a[i][j] + " ");
                out.println();
            }
    }

    class Pair implements Comparable<Pair>{
        int a;
        int b;

        Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        public int compareTo(Pair p) {
            if (a > p.a) return 1;
            if (a < p.a) return -1;
            if (b > p.b) return 1;
            if (b < p.b) return -1;
            return 0;
        }
    }

    class Item {

        int a;
        int b;
        int c;

        Item(int a, int b, int c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }

    }

    class Reader {

        BufferedReader  br;
        StringTokenizer tok;

        Reader(String file) throws IOException {
            br = new BufferedReader( new FileReader(file) );
        }

        Reader() throws IOException {
            br = new BufferedReader( new InputStreamReader(System.in) );
        }

        String next() throws IOException {

            while (tok == null || !tok.hasMoreElements())
                tok = new StringTokenizer(br.readLine());
            return tok.nextToken();
        }

        int nextInt() throws NumberFormatException, IOException {
            return Integer.valueOf(next());
        }

        long nextLong() throws NumberFormatException, IOException {
            return Long.valueOf(next());
        }

        double nextDouble() throws NumberFormatException, IOException {
            return Double.valueOf(next());
        }


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

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

        ArrayList<Integer>[] nextGraph(int n, int m) throws IOException {
            ArrayList<Integer>[] g = new ArrayList[n];
            for (int i = 0; i < n; i++)
                g[i] = new ArrayList<>();
            for (int i = 0; i < m; i++) {
                int x = nextInt() - 1;
                int y = nextInt() - 1;
                g[x].add(y);
                g[y].add(x);
            }

            return g;
        }

    }

}