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.*;
import java.math.*;
import java.lang.reflect.Array;

public class Main {
    static FastReader R = new FastReader();
    static StringBuilder sb = new StringBuilder();
    static final int MOD = 1000000007;
    public static void main(String[] args) {
        int n = num();
        int half = n/2;
        int[] arr = new int[1001];
        for (int i = 0; i < n*n; i++)
            arr[num()]++;
        int[][] res = new int[half+1][half+1];
        int[] resMid = new int[n+1];
        int index = 1, midIndex = 1;
        if (n%2 == 0) {
            for (int i = 1; i < 1001; i++) {
                while (arr[i] >= 4) {
                    int y = index/half + (index%half == 0 ? 0 : 1);
                    int x = index%half == 0 ? half : index%half;
                    res[x][y] = i;
                    arr[i] -= 4;
                    index++;
                }
                if (arr[i] != 0) {
                    println("NO");
                    return;
                }
            }
        } else {
            for (int i = 1; i < 1001; i++) {
                while (arr[i] >= 4 && index <= half*half) {
                    int y = index/half + (index%half == 0 ? 0 : 1);
                    int x = index%half == 0 ? half : index%half;
                    res[x][y] = i;
                    arr[i] -= 4;
                    index++;
                }
                while (arr[i] >= 2) {
                    if (midIndex > n) {
                        println("NO");
                        return;
                    }
                    resMid[midIndex++] = i;
                    arr[i] -= 2;
                    if (midIndex == half+1)
                        midIndex++;
                }
                while (arr[i] >= 1) {
                    if (resMid[half+1] != 0) {
                        println("NO");
                        return;
                    }
                    resMid[half+1] = i;
                    arr[i]--;
                }
            }
        }
        index = 1;
        outln("YES");
        for (; index <= n*n; index++) {
            int x = index%n == 0 ? n : index%n;
            int i = x > half ? n-x+1 : x;
            int y = (x == n ? 0 : 1) + index/n;
            int j = y > half ? n-y+1 : y;
            boolean xMid = x == half+1,
                    yMid = y == half+1;
            if (n%2 == 1 && (xMid || yMid))
                out(resMid[xMid && yMid ? half+1 : xMid ? j : i+half+1]);
            else
                out(res[i][j]);
            if (x == n)
                outln();
            else
                out(" ");
        }
        flush();
    }
    static long ll() {
        return R.nextLong();
    }
    static int num() {
        return R.nextInt();
    }
    static String line() {
        return R.nextLine();
    }
    static void println(Object o) {
        outln(o);
        flush();
    }
    static void print(Object o) {
        out(o);
        flush();
    }
    static void flush() {
        System.out.print(sb.toString());
        sb.setLength(0);
    }
    static void out(Object o) {
        sb.append(o.toString());
    }
    static void outln(Object o) {
        out(o);
        outln();
    }
    static void outln() {
        sb.append("\n");
    }
    static void logArr(Object val) {
        Class<?> valKlass = val.getClass();
        Object[] outputArray = null;
        for(Class<?> arrKlass : new Class<?>[] { int[].class, float[].class, double[].class, boolean[].class, 
            byte[].class, short[].class, long[].class, char[].class }) {
            if (valKlass.isAssignableFrom(arrKlass)) {
                int arrlength = Array.getLength(val);
                outputArray = new Object[arrlength];
                for(int i = 0; i < arrlength; ++i)
                    outputArray[i] = Array.get(val, i);
                break;
            }
        }
        if(outputArray == null)
            outputArray = (Object[])val;
        logArr0(outputArray);
    }
    static void logArr0(Object[] objs) {
        out("* " + objs[0]);
        for (int i = 1; i < objs.length; i++)
            out(", " + objs[i]);
        outln();
        flush();
    }
    static void log(Object... objs) {
        logArr0(objs);
    }
    static class FastReader {
        public BufferedReader reader;
        public StringTokenizer st;
        private StringBuilder sb = new StringBuilder();
        public FastReader() {
            reader = new BufferedReader(new InputStreamReader(System.in), 32768);
        }
        public String next() {
            return tokenize() ? st.nextToken() : null;
        }
        private boolean tokenize() {
            if (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    return false;
                }
            }
            return true;
        }
        public String nextLine() {
            if (!tokenize())
                return null;
            sb.setLength(0);
            if (st.hasMoreTokens())
                sb.append(st.nextToken());
            while (st.hasMoreTokens())
                sb.append(' ').append(st.nextToken());
            return sb.length() == 0 ? null : sb.toString();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}