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

import static java.lang.Math.*;
import static java.util.Arrays.*;

// 7:15.165 +

public class cf1381c {

    public static void main(String[] args) throws IOException {
        int t = ri();
        while (t --> 0) {
            int n = rni(), x = ni(), y = ni() - x, b[] = ria(n), ans[] = new int[n], filler = 1;
            fill(ans, -1);
            Map<Integer, Queue<Integer>> inds = new HashMap<>();
            for (int i = 0; i < n; ++i) {
                inds.computeIfAbsent(b[i], key -> new LinkedList<>()).offer(i);
                while (inds.containsKey(filler)) {
                    ++filler;
                }
            }
            PriorityQueue<int[]> selection = new PriorityQueue<>((aa, bb) -> bb[1] - aa[1]);
            for (int key : inds.keySet()) {
                selection.offer(new int[] {key, inds.get(key).size()});
            }
            for (int i = 0; i < x; ++i) {
                int select[] = selection.poll(), num = select[0], count = select[1];
                ans[inds.get(num).peek()] = b[inds.get(num).poll()];
                if (count > 1) {
                    selection.offer(new int[] {num, count - 1});
                }
            }
            if (x < n) {
                if (selection.peek()[1] > (n - x) / 2 && y > 2 * (n - x - selection.peek()[1])) {
                    prN();
                    continue;
                }
                int max = selection.peek()[1], dummy[] = new int[n];
                // prln(max);
                List<Integer> indices = new ArrayList<>();
                // swap y w/ free slots: fill bigger chunks w/ filler
                y = n - x - y;
                while (!selection.isEmpty()) {
                    int select[] = selection.poll(), num = select[0], count = select[1];
                    for (int i = 0; i < count; ++i) {
                        indices.add(inds.get(num).peek());
                        // prln(inds.get(num).peek());
                        if (y --> 0) {
                            dummy[inds.get(num).poll()] = filler;
                        } else {
                            dummy[inds.get(num).peek()] = b[inds.get(num).poll()];
                        }
                    }
                }
                // prln(dummy);
                // rotation to mismatch
                for (int i = 0; i < n - x; ++i) {
                    ans[indices.get((i + n - x - max) % (n - x))] = dummy[indices.get(i)];
                }
            }
            prY();
            prln(ans);
        }
        close();
    }

    static BufferedReader __in = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter __out = new PrintWriter(new OutputStreamWriter(System.out));
    static StringTokenizer input;
    static Random __rand = new Random();

    // references
    // IBIG = 1e9 + 7
    // IMAX ~= 2e9
    // LMAX ~= 9e18

    // constants
    static final int IBIG = 1000000007;
    static final int IMAX = 2147483647;
    static final int IMIN = -2147483648;
    static final long LMAX = 9223372036854775807L;
    static final long LMIN = -9223372036854775808L;
    // math util
    static int minof(int a, int b, int c) {return min(a, min(b, c));}
    static int minof(int... x) {if (x.length == 1) return x[0]; if (x.length == 2) return min(x[0], x[1]); if (x.length == 3) return min(x[0], min(x[1], x[2])); int min = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] < min) min = x[i]; return min;}
    static long minof(long a, long b, long c) {return min(a, min(b, c));}
    static long minof(long... x) {if (x.length == 1) return x[0]; if (x.length == 2) return min(x[0], x[1]); if (x.length == 3) return min(x[0], min(x[1], x[2])); long min = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] < min) min = x[i]; return min;}
    static int maxof(int a, int b, int c) {return max(a, max(b, c));}
    static int maxof(int... x) {if (x.length == 1) return x[0]; if (x.length == 2) return max(x[0], x[1]); if (x.length == 3) return max(x[0], max(x[1], x[2])); int max = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] > max) max = x[i]; return max;}
    static long maxof(long a, long b, long c) {return max(a, max(b, c));}
    static long maxof(long... x) {if (x.length == 1) return x[0]; if (x.length == 2) return max(x[0], x[1]); if (x.length == 3) return max(x[0], max(x[1], x[2])); long max = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] > max) max = x[i]; return max;}
    static int powi(int a, int b) {if (a == 0) return 0; int ans = 1; while (b > 0) {if ((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static long powl(long a, int b) {if (a == 0) return 0; long ans = 1; while (b > 0) {if ((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static int fli(double d) {return (int) d;}
    static int cei(double d) {return (int) ceil(d);}
    static long fll(double d) {return (long) d;}
    static long cel(double d) {return (long) ceil(d);}
    static int gcf(int a, int b) {return b == 0 ? a : gcf(b, a % b);}
    static long gcf(long a, long b) {return b == 0 ? a : gcf(b, a % b);}
    static int lcm(int a, int b) {return a * b / gcf(a, b);}
    static long lcm(long a, long b) {return a * b / gcf(a, b);}
    static int randInt(int min, int max) {return __rand.nextInt(max - min + 1) + min;}
    static long mix(long x) {x += 0x9e3779b97f4a7c15L; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9L; x = (x ^ (x >> 27)) * 0x94d049bb133111ebL; return x ^ (x >> 31);}
    // array util
    static void reverse(int[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {int swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(long[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {long swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(double[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {double swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(char[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {char swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void shuffle(int[] a) {int n = a.length - 1; for (int i = 0; i < n; ++i) {int ind = randInt(i, n); int swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(long[] a) {int n = a.length - 1; for (int i = 0; i < n; ++i) {int ind = randInt(i, n); long swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(double[] a) {int n = a.length - 1; for (int i = 0; i < n; ++i) {int ind = randInt(i, n); double swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void rsort(int[] a) {shuffle(a); sort(a);}
    static void rsort(long[] a) {shuffle(a); sort(a);}
    static void rsort(double[] a) {shuffle(a); sort(a);}
    static int[] copy(int[] a) {int[] ans = new int[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static long[] copy(long[] a) {long[] ans = new long[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static double[] copy(double[] a) {double[] ans = new double[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static char[] copy(char[] a) {char[] ans = new char[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    // graph util
    static List<List<Integer>> g(int n) {List<List<Integer>> g = new ArrayList<>(); for (int i = 0; i < n; ++i) g.add(new ArrayList<>()); return g;}
    static List<Set<Integer>> sg(int n) {List<Set<Integer>> g = new ArrayList<>(); for (int i = 0; i < n; ++i) g.add(new HashSet<>()); return g;}
    static void c(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v); g.get(v).add(u);}
    static void cto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v);}
    static void dc(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v); g.get(v).remove(u);}
    static void dcto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v);}
    // input
    static void r() throws IOException {input = new StringTokenizer(rline());}
    static int ri() throws IOException {return Integer.parseInt(rline());}
    static long rl() throws IOException {return Long.parseLong(rline());}
    static double rd() throws IOException {return Double.parseDouble(rline());}
    static int[] ria(int n) throws IOException {int[] a = new int[n]; r(); for (int i = 0; i < n; ++i) a[i] = ni(); return a;}
    static int[] riam1(int n) throws IOException {int[] a = new int[n]; r(); for (int i = 0; i < n; ++i) a[i] = ni() - 1; return a;}
    static long[] rla(int n) throws IOException {long[] a = new long[n]; r(); for (int i = 0; i < n; ++i) a[i] = nl(); return a;}
    static double[] rda(int n) throws IOException {double[] a = new double[n]; r(); for (int i = 0; i < n; ++i) a[i] = nd(); return a;}
    static char[] rcha() throws IOException {return rline().toCharArray();}
    static String rline() throws IOException {return __in.readLine();}
    static String n() {return input.nextToken();}
    static int rni() throws IOException {r(); return ni();}
    static int ni() {return Integer.parseInt(n());}
    static long rnl() throws IOException {r(); return nl();}
    static long nl() {return Long.parseLong(n());}
    static double rnd() throws IOException {r(); return nd();}
    static double nd() {return Double.parseDouble(n());}
    static List<List<Integer>> rg(int n, int m) throws IOException {List<List<Integer>> g = g(n); for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1); return g;}
    static void rg(List<List<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1);}
    static List<List<Integer>> rdg(int n, int m) throws IOException {List<List<Integer>> g = g(n); for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1); return g;}
    static void rdg(List<List<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1);}
    static List<Set<Integer>> rsg(int n, int m) throws IOException {List<Set<Integer>> g = sg(n); for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1); return g;}
    static void rsg(List<Set<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1);}
    static List<Set<Integer>> rdsg(int n, int m) throws IOException {List<Set<Integer>> g = sg(n); for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1); return g;}
    static void rdsg(List<Set<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1);}
    // output
    static void pr(int i) {__out.print(i);}
    static void prln(int i) {__out.println(i);}
    static void pr(long l) {__out.print(l);}
    static void prln(long l) {__out.println(l);}
    static void pr(double d) {__out.print(d);}
    static void prln(double d) {__out.println(d);}
    static void pr(char c) {__out.print(c);}
    static void prln(char c) {__out.println(c);}
    static void pr(char[] s) {__out.print(new String(s));}
    static void prln(char[] s) {__out.println(new String(s));}
    static void pr(String s) {__out.print(s);}
    static void prln(String s) {__out.println(s);}
    static void pr(Object o) {__out.print(o);}
    static void prln(Object o) {__out.println(o);}
    static void prln() {__out.println();}
    static void pryes() {prln("yes");}
    static void pry() {prln("Yes");}
    static void prY() {prln("YES");}
    static void prno() {prln("no");}
    static void prn() {prln("No");}
    static void prN() {prln("NO");}
    static void pryesno(boolean b) {prln(b ? "yes" : "no");};
    static void pryn(boolean b) {prln(b ? "Yes" : "No");}
    static void prYN(boolean b) {prln(b ? "YES" : "NO");}
    static void prln(int... a) {for (int i = 0, len = a.length - 1; i < len; pr(a[i]), pr(' '), ++i); if (a.length > 0) prln(a[a.length - 1]); else prln();}
    static void prln(long... a) {for (int i = 0, len = a.length - 1; i < len; pr(a[i]), pr(' '), ++i); if (a.length > 0) prln(a[a.length - 1]); else prln();}
    static void prln(double... a) {for (int i = 0, len = a.length - 1; i < len; pr(a[i]), pr(' '), ++i); if (a.length > 0) prln(a[a.length - 1]); else prln();}
    static <T> void prln(Collection<T> c) {int n = c.size() - 1; Iterator<T> iter = c.iterator(); for (int i = 0; i < n; pr(iter.next()), pr(' '), ++i); if (n >= 0) prln(iter.next()); else prln();}
    static void h() {prln("hlfd"); flush();}
    static void flush() {__out.flush();}
    static void close() {__out.close();}}


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

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class cf1381c {

    public static void main(String[] args) throws IOException {
        int t = ri();
        next: while(t --> 0) {
            int n = rni(), x = ni(), y = ni() - x, b[] = ria(n), ans[] = new int[n], notused = 1;

            Map<Integer, Queue<Integer>> cnt = new HashMap<>();
            Set<Integer> used = new HashSet<>(), left = new HashSet<>();
            for(int i = 0; i < n; ++i) {
                used.add(b[i]);
                left.add(i);
                cnt.computeIfAbsent(b[i], k -> new LinkedList<>()).offer(i);
            }
            while(used.contains(notused)) {
                ++notused;
            }

            PriorityQueue<int[]> pq = new PriorityQueue<>((p, q) -> q[1] - p[1]);
            for(int k : cnt.keySet()) {
                pq.offer(new int[] {k, cnt.get(k).size()});
            }
            for(int i = 0; i < x; ++i) {
                int e[] = pq.poll(), ind = cnt.get(e[0]).poll(), sz = e[1];
                ans[ind] = b[ind];
                left.remove(ind);
                if(sz == 1) {
                    cnt.remove(e[0]);
                } else {
                    pq.offer(new int[] {e[0], sz - 1});
                }
            }

            if(y == 1) {
                if(cnt.keySet().size() == 1) {
                    prN();
                    continue next;
                } else {
                    int clr = -1;
                    for(int k : cnt.keySet()) {
                        if(clr == -1) {
                            clr = k;
                        } else {
                            ans[cnt.get(k).poll()] = clr;
                            break;
                        }
                    }
                }

                for(int i = 0; i < n; ++i) {
                    if(ans[i] == 0) {
                        ans[i] = notused;
                    }
                }
            } else {
                /* List<int[]> mismatch = new ArrayList<>();
                while(mismatch.size() < y) {
                    Set<Integer> remove = new HashSet<>();
                    for(int k : cnt.keySet()) {
                        mismatch.add(new int[] {k, cnt.get(k).poll()});
                        if(cnt.get(k).isEmpty()) {
                            remove.add(k);
                        }
                        if(mismatch.size() == y) {
                            break;
                        }
                    }
                    for(int i : remove) {
                        cnt.remove(i);
                    }
                }
                mismatch.sort((p, q) -> p[0] - q[0]);
                for(int i = 0; i < y; ++i) {
                    int clr = mismatch.get(i)[0], ind = mismatch.get((i + y / 2) % y)[1];
                    if(b[ind] == clr) {
                        prN();
                        continue next;
                    } else {
                        ans[ind] = clr;
                    }
                }

                for(int i = 0; i < n; ++i) {
                    if(ans[i] == 0) {
                        ans[i] = notused;
                    }
                } */
                List<int[]> mismatch = new ArrayList<>();
                for(int k : cnt.keySet()) {
                    while(!cnt.get(k).isEmpty()) {
                        mismatch.add(new int[] {k, cnt.get(k).poll()});
                    }
                }
                mismatch.sort((p, q) -> p[0] - q[0]);
                for(int i = 0; i < n - x; ++i) {
                    int clr = mismatch.get(i)[0], ind = mismatch.get((i + (n - x) / 2) % (n - x))[1];
                    ans[ind] = clr;
                }
                int buf = n - x - y;
                for(int i : left) {
                    if(ans[i] == b[i]) {
                        ans[i] = notused;
                        if(--buf < 0) {
                            prN();
                            continue next;
                        }
                    }
                }
            }

            prY();
            prln(ans);
        }
        close();
    }

    static BufferedReader __in = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter __out = new PrintWriter(new OutputStreamWriter(System.out));
    static StringTokenizer input;
    static Random rand = new Random();

    // references
    // IBIG = 1e9 + 7
    // IMAX ~= 2e10
    // LMAX ~= 9e18

    // constants
    static final int IBIG = 1000000007;
    static final int IMAX = 2147483647;
    static final int IMIN = -2147483648;
    static final long LMAX = 9223372036854775807L;
    static final long LMIN = -9223372036854775808L;
    // math util
    static int minof(int a, int b, int c) {return min(a, min(b, c));}
    static int minof(int... x) {if(x.length == 1) return x[0]; if(x.length == 2) return min(x[0], x[1]); if(x.length == 3) return min(x[0], min(x[1], x[2])); int min = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] < min) min = x[i]; return min;}
    static long minof(long a, long b, long c) {return min(a, min(b, c));}
    static long minof(long... x) {if(x.length == 1) return x[0]; if(x.length == 2) return min(x[0], x[1]); if(x.length == 3) return min(x[0], min(x[1], x[2])); long min = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] < min) min = x[i]; return min;}
    static int maxof(int a, int b, int c) {return max(a, max(b, c));}
    static int maxof(int... x) {if(x.length == 1) return x[0]; if(x.length == 2) return max(x[0], x[1]); if(x.length == 3) return max(x[0], max(x[1], x[2])); int max = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] > max) max = x[i]; return max;}
    static long maxof(long a, long b, long c) {return max(a, max(b, c));}
    static long maxof(long... x) {if(x.length == 1) return x[0]; if(x.length == 2) return max(x[0], x[1]); if(x.length == 3) return max(x[0], max(x[1], x[2])); long max = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] > max) max = x[i]; return max;}
    static int powi(int a, int b) {if(a == 0) return 0; int ans = 1; while(b > 0) {if((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static long powl(long a, int b) {if(a == 0) return 0; long ans = 1; while(b > 0) {if((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static int fli(double d) {return (int)d;}
    static int cei(double d) {return (int)ceil(d);}
    static long fll(double d) {return (long)d;}
    static long cel(double d) {return (long)ceil(d);}
    static int randInt(int min, int max) {return rand.nextInt(max - min + 1) + min;}
    // array util
    static void reverse(int[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {int swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(long[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {long swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(char[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {char swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void shuffle(int[] a) {int n = a.length - 1; for(int i = 0; i < n; ++i) {int ind = randInt(i, n); int swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(long[] a) {int n = a.length - 1; for(int i = 0; i < n; ++i) {int ind = randInt(i, n); long swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void rsort(int[] a) {shuffle(a); sort(a);}
    static void rsort(long[] a) {shuffle(a); sort(a);}
    static int[] copy(int[] a) {int[] ans = new int[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static long[] copy(long[] a) {long[] ans = new long[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static char[] copy(char[] a) {char[] ans = new char[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static int[] sorted(int[] a) {int[] ans = copy(a); sort(ans); return ans;}
    static long[] sorted(long[] a) {long[] ans = copy(a); sort(ans); return ans;}
    static int[] rsorted(int[] a) {int[] ans = copy(a); rsort(ans); return ans;}
    static long[] rsorted(long[] a) {long[] ans = copy(a); rsort(ans); return ans;}
    // graph util
    static List<List<Integer>> graph(int n) {List<List<Integer>> g = new ArrayList<>(); for(int i = 0; i < n; ++i) g.add(new ArrayList<>()); return g;}
    static List<List<Integer>> graph(List<List<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) connect(g, rni() - 1, ni() - 1); return g;}
    static List<List<Integer>> graph(int n, int m) throws IOException {return graph(graph(n), m);}
    static List<List<Integer>> dgraph(List<List<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) connecto(g, rni() - 1, ni() - 1); return g;}
    static List<List<Integer>> dgraph(List<List<Integer>> g, int n, int m) throws IOException {return dgraph(graph(n), m);}
    static List<Set<Integer>> sgraph(int n) {List<Set<Integer>> g = new ArrayList<>(); for(int i = 0; i < n; ++i) g.add(new HashSet<>()); return g;}
    static List<Set<Integer>> sgraph(List<Set<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) connect(g, rni() - 1, ni() - 1); return g;}
    static List<Set<Integer>> sgraph(int n, int m) throws IOException {return sgraph(sgraph(n), m);}
    static List<Set<Integer>> dsgraph(List<Set<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) connecto(g, rni() - 1, ni() - 1); return g;}
    static List<Set<Integer>> dsgraph(List<Set<Integer>> g, int n, int m) throws IOException {return dsgraph(sgraph(n), m);}
    static void connect(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v); g.get(v).add(u);}
    static void connecto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v);}
    static void dconnect(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v); g.get(v).remove(u);}
    static void dconnecto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v);}
    // input
    static void r() throws IOException {input = new StringTokenizer(__in.readLine());}
    static int ri() throws IOException {return Integer.parseInt(__in.readLine());}
    static long rl() throws IOException {return Long.parseLong(__in.readLine());}
    static int[] ria(int n) throws IOException {int[] a = new int[n]; input = new StringTokenizer(__in.readLine()); for(int i = 0; i < n; ++i) a[i] = Integer.parseInt(input.nextToken()); return a;}
    static int[] riam1(int n) throws IOException {int[] a = new int[n]; input = new StringTokenizer(__in.readLine()); for(int i = 0; i < n; ++i) a[i] = Integer.parseInt(input.nextToken()) - 1; return a;}
    static long[] rla(int n) throws IOException {long[] a = new long[n]; input = new StringTokenizer(__in.readLine()); for(int i = 0; i < n; ++i) a[i] = Long.parseLong(input.nextToken()); return a;}
    static char[] rcha() throws IOException {return __in.readLine().toCharArray();}
    static String rline() throws IOException {return __in.readLine();}
    static int rni() throws IOException {input = new StringTokenizer(__in.readLine()); return Integer.parseInt(input.nextToken());}
    static int ni() {return Integer.parseInt(input.nextToken());}
    static long rnl() throws IOException {input = new StringTokenizer(__in.readLine()); return Long.parseLong(input.nextToken());}
    static long nl() {return Long.parseLong(input.nextToken());}
    // output
    static void pr(int i) {__out.print(i);}
    static void prln(int i) {__out.println(i);}
    static void pr(long l) {__out.print(l);}
    static void prln(long l) {__out.println(l);}
    static void pr(double d) {__out.print(d);}
    static void prln(double d) {__out.println(d);}
    static void pr(char c) {__out.print(c);}
    static void prln(char c) {__out.println(c);}
    static void pr(char[] s) {__out.print(new String(s));}
    static void prln(char[] s) {__out.println(new String(s));}
    static void pr(String s) {__out.print(s);}
    static void prln(String s) {__out.println(s);}
    static void pr(Object o) {__out.print(o);}
    static void prln(Object o) {__out.println(o);}
    static void prln() {__out.println();}
    static void pryes() {__out.println("yes");}
    static void pry() {__out.println("Yes");}
    static void prY() {__out.println("YES");}
    static void prno() {__out.println("no");}
    static void prn() {__out.println("No");}
    static void prN() {__out.println("NO");}
    static void pryesno(boolean b) {__out.println(b ? "yes" : "no");};
    static void pryn(boolean b) {__out.println(b ? "Yes" : "No");}
    static void prYN(boolean b) {__out.println(b ? "YES" : "NO");}
    static void prln(int... a) {for(int i = 0, len = a.length - 1; i < len; __out.print(a[i]), __out.print(' '), ++i); __out.println(a[a.length - 1]);}
    static void prln(long... a) {for(int i = 0, len = a.length - 1; i < len; __out.print(a[i]), __out.print(' '), ++i); __out.println(a[a.length - 1]);}
    static <T> void prln(Collection<T> c) {int n = c.size() - 1; Iterator<T> iter = c.iterator(); for(int i = 0; i < n; __out.print(iter.next()), __out.print(' '), ++i); if(n >= 0) __out.println(iter.next()); else __out.println();}
    static void h() {__out.println("hlfd");}
    static void flush() {__out.flush();}
    static void close() {__out.close();}
}


//package round658;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;

public class C {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		for(int T = ni();T > 0;T--){
			go();
		}
	}

	void go()
	{
		int n = ni(), x = ni(), y = ni();
		int[] a = na(n);
		int[] f = new int[n+1];
		for(int v : a){
			f[v-1]++;
		}
		MinHeap h = new MinHeap(n+1);
		for(int i = 0;i < n+1;i++){
			if(f[i] > 0){
				h.add(i, -f[i]);
			}
		}
		int nomat = -1;
		for(int i = 0;i <= n;i++){
			if(f[i] == 0)nomat = i;
		}

		int[] mat = new int[n+1];
		for(int i = 0;i < x;i++){
			int u = h.argmin();
			mat[u]++;
			f[u]--;
			h.update(u, h.min() + 1);
		}

		// SUP: sum min(f, n-f)

		// 4-3+2=3

		if((y-x > 0 && -h.min() == n-x) || y-x > n-x-(-h.min()) + Math.min(-h.min(), n-x-(-h.min()))){
			out.println("NO");
			return;
		}

		out.println("YES");
		int[] b = new int[n];
		int[][] rm = new int[n][];
		int p = 0;
		for(int i = 0;i < n;i++){
			if(mat[a[i]-1] > 0){
				mat[a[i]-1]--;
				b[i] = a[i];
			}else{
				rm[p++] = new int[]{a[i], i};
			}
		}
		Arrays.sort(rm, 0, p, new Comparator<int[]>() {
			public int compare(int[] a, int[] b) {
				return a[0] - b[0];
			}
		});
		int mf = (n-x)/2;

		int done = 0;
		for(int i = 0, j = mf;i < p;i++,j++){
			if(j == p)j = 0;

			if(a[rm[j][1]] == rm[i][0] || done >= y-x){
				b[rm[j][1]] = nomat+1;
			}else{
				b[rm[j][1]] = rm[i][0];
				done++;
			}
		}
		for(int v : b){
			out.print(v + " ");
		}
		out.println();

//		tr("ans", b);
//		check(b, a, x, y);
	}

	void check(int[] b, int[] a, int xx, int yy)
	{
		int n = a.length;
		for(int i = 0;i < n;i++)a[i]--;
		for(int i = 0;i < n;i++)b[i]--;
		int[] fa = new int[n+1];
		for(int v : a)fa[v]++;
		int[] fb = new int[n+1];
		for(int v : b)fb[v]++;
		int pmat = 0;
		for(int i = 0;i < n;i++){
			if(a[i] == b[i])pmat++;
		}

		int mat = 0;
		for(int i = 0;i <= n;i++){
			mat += Math.min(fa[i], fb[i]);
		}
		tr(pmat, mat, xx, yy);

		assert pmat == xx;
		assert mat == yy;
	}

	public static class MinHeap {
		public int[] a;
		public int[] map;
		public int[] imap;
		public int n;
		public int pos;
		public static int INF = Integer.MAX_VALUE;

		public MinHeap(int m)
		{
			n = m+2;
			a = new int[n];
			map = new int[n];
			imap = new int[n];
			Arrays.fill(a, INF);
			Arrays.fill(map, -1);
			Arrays.fill(imap, -1);
			pos = 1;
		}

		public int add(int ind, int x)
		{
			int ret = imap[ind];
			if(imap[ind] < 0){
				a[pos] = x; map[pos] = ind; imap[ind] = pos;
				pos++;
				up(pos-1);
			}
			return ret != -1 ? a[ret] : x;
		}

		public int update(int ind, int x)
		{
			int ret = imap[ind];
			if(imap[ind] < 0){
				a[pos] = x; map[pos] = ind; imap[ind] = pos;
				pos++;
				up(pos-1);
			}else{
				int o = a[ret];
				a[ret] = x;
				up(ret);
				down(ret);
//				if(a[ret] > o){
//					up(ret);
//				}else{
//					down(ret);
//				}
			}
			return x;
		}

		public int remove(int ind)
		{
			if(pos == 1)return INF;
			if(imap[ind] == -1)return INF;

			pos--;
			int rem = imap[ind];
			int ret = a[rem];
			map[rem] = map[pos];
			imap[map[pos]] = rem;
			imap[ind] = -1;
			a[rem] = a[pos];
			a[pos] = INF;
			map[pos] = -1;

			up(rem);
			down(rem);
			return ret;
		}

		public int min() { return a[1]; }
		public int argmin() { return map[1]; }
		public int size() {	return pos-1; }

		private void up(int cur)
		{
			for(int c = cur, p = c>>>1;p >= 1 && a[p] > a[c];c>>>=1, p>>>=1){
				int d = a[p]; a[p] = a[c]; a[c] = d;
				int e = imap[map[p]]; imap[map[p]] = imap[map[c]]; imap[map[c]] = e;
				e = map[p]; map[p] = map[c]; map[c] = e;
			}
		}

		private void down(int cur)
		{
			for(int c = cur;2*c < pos;){
				int b = a[2*c] < a[2*c+1] ? 2*c : 2*c+1;
				if(a[b] < a[c]){
					int d = a[c]; a[c] = a[b]; a[b] = d;
					int e = imap[map[c]]; imap[map[c]] = imap[map[b]]; imap[map[b]] = e;
					e = map[c]; map[c] = map[b]; map[b] = e;
					c = b;
				}else{
					break;
				}
			}
		}
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new C().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round658;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;

public class C {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		for(int T = ni();T > 0;T--){
			go();
		}
	}

	void go()
	{
		int n = ni(), x = ni(), y = ni();
		int[] a = na(n);
		int[] f = new int[n+1];
		for(int v : a){
			f[v-1]++;
		}
		MinHeap h = new MinHeap(n+1);
		for(int i = 0;i < n+1;i++){
			if(f[i] > 0){
				h.add(i, -f[i]);
			}
		}
		int nomat = -1;
		for(int i = 0;i <= n;i++){
			if(f[i] == 0)nomat = i;
		}

		int[] mat = new int[n+1];
		for(int i = 0;i < x;i++){
			int u = h.argmin();
			mat[u]++;
			f[u]--;
			h.update(u, h.min() + 1);
		}

		// SUP: sum min(f, n-f)

		// 4-3+2=3

		if(-h.min() == n-x || y-x > n-x-(-h.min()) + Math.min(-h.min(), n-x-(-h.min()))){
			out.println("NO");
			return;
		}

		out.println("YES");
		int[] b = new int[n];
		int[][] rm = new int[n][];
		int p = 0;
		for(int i = 0;i < n;i++){
			if(mat[a[i]-1] > 0){
				mat[a[i]-1]--;
				b[i] = a[i];
			}else{
				rm[p++] = new int[]{a[i], i};
			}
		}
		Arrays.sort(rm, 0, p, new Comparator<int[]>() {
			public int compare(int[] a, int[] b) {
				return a[0] - b[0];
			}
		});
//		int mf = 0;
//		for(int v : f){
//			mf = Math.max(v, mf);
//		}
//		tr(b, mf, rm);
		int mf = (n-x)/2;

		int done = 0;
		for(int i = 0, j = mf;i < p;i++,j++){
			if(j == p)j = 0;

			if(a[rm[j][1]] == rm[i][0] || done >= y-x){
				b[rm[j][1]] = nomat+1;
			}else{
				b[rm[j][1]] = rm[i][0];
				done++;
			}
		}
		for(int v : b){
			out.print(v + " ");
		}
		out.println();

//		tr("ans", b);
//		check(b, a, x, y);
	}

	void check(int[] b, int[] a, int xx, int yy)
	{
		int n = a.length;
		for(int i = 0;i < n;i++)a[i]--;
		for(int i = 0;i < n;i++)b[i]--;
		int[] fa = new int[n+1];
		for(int v : a)fa[v]++;
		int[] fb = new int[n+1];
		for(int v : b)fb[v]++;
		int pmat = 0;
		for(int i = 0;i < n;i++){
			if(a[i] == b[i])pmat++;
		}

		int mat = 0;
		for(int i = 0;i <= n;i++){
			mat += Math.min(fa[i], fb[i]);
		}
		tr(pmat, mat, xx, yy);

		assert pmat == xx;
		assert mat == yy;
	}

	public static class MinHeap {
		public int[] a;
		public int[] map;
		public int[] imap;
		public int n;
		public int pos;
		public static int INF = Integer.MAX_VALUE;

		public MinHeap(int m)
		{
			n = m+2;
			a = new int[n];
			map = new int[n];
			imap = new int[n];
			Arrays.fill(a, INF);
			Arrays.fill(map, -1);
			Arrays.fill(imap, -1);
			pos = 1;
		}

		public int add(int ind, int x)
		{
			int ret = imap[ind];
			if(imap[ind] < 0){
				a[pos] = x; map[pos] = ind; imap[ind] = pos;
				pos++;
				up(pos-1);
			}
			return ret != -1 ? a[ret] : x;
		}

		public int update(int ind, int x)
		{
			int ret = imap[ind];
			if(imap[ind] < 0){
				a[pos] = x; map[pos] = ind; imap[ind] = pos;
				pos++;
				up(pos-1);
			}else{
				int o = a[ret];
				a[ret] = x;
				up(ret);
				down(ret);
//				if(a[ret] > o){
//					up(ret);
//				}else{
//					down(ret);
//				}
			}
			return x;
		}

		public int remove(int ind)
		{
			if(pos == 1)return INF;
			if(imap[ind] == -1)return INF;

			pos--;
			int rem = imap[ind];
			int ret = a[rem];
			map[rem] = map[pos];
			imap[map[pos]] = rem;
			imap[ind] = -1;
			a[rem] = a[pos];
			a[pos] = INF;
			map[pos] = -1;

			up(rem);
			down(rem);
			return ret;
		}

		public int min() { return a[1]; }
		public int argmin() { return map[1]; }
		public int size() {	return pos-1; }

		private void up(int cur)
		{
			for(int c = cur, p = c>>>1;p >= 1 && a[p] > a[c];c>>>=1, p>>>=1){
				int d = a[p]; a[p] = a[c]; a[c] = d;
				int e = imap[map[p]]; imap[map[p]] = imap[map[c]]; imap[map[c]] = e;
				e = map[p]; map[p] = map[c]; map[c] = e;
			}
		}

		private void down(int cur)
		{
			for(int c = cur;2*c < pos;){
				int b = a[2*c] < a[2*c+1] ? 2*c : 2*c+1;
				if(a[b] < a[c]){
					int d = a[c]; a[c] = a[b]; a[b] = d;
					int e = imap[map[c]]; imap[map[c]] = imap[map[b]]; imap[map[b]] = e;
					e = map[c]; map[c] = map[b]; map[b] = e;
					c = b;
				}else{
					break;
				}
			}
		}
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new C().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


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

public class F {
	public static void main (String[] args) { new F(); }

	public F() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("");

		int T = fs.nextInt();
		while(T-->0) {
			int n = fs.nextInt();
			int x = fs.nextInt(), y = fs.nextInt();
			int[] a = fs.nextIntArray(n);
			int[] freq = new int[n + 2];
			for(int i : a) freq[i]++;
			int[] freqC = freq.clone();

			int dummy = 1;
			for(int i = 1; i <= n+1; i++) {
				if(freq[i] == 0) dummy = i;
			}

			ArrayDeque<Integer>[] locs = new ArrayDeque[n + 2];
			for(int i = 0; i < locs.length; i++) locs[i] = new ArrayDeque<>();
			for(int i = 0; i < n; i++) locs[a[i]].add(i);

			PriorityQueue<Item> pq = new PriorityQueue<>();
			for(int i = 1; i <= n + 1; i++) {
				if(freq[i] > 0) pq.add(new Item(i, freq[i]));
			}

			int[] res = new int[n];
			int needX = x;
			while(needX > 0) {
				Item who = pq.poll();
				freq[who.num]--;
				who.freq--;
				int spot = locs[who.num].pollFirst();
				res[spot] = who.num;
				needX--;

				if(who.freq > 0) pq.add(who);
			}

			ArrayList<Elem> rem = new ArrayList<>();
			for(int i = 0; i < n; i++) {
				if(res[i] == 0) rem.add(new Elem(i, a[i]));
			}

			Collections.sort(rem);
			ArrayList<Elem> shifted = shift(rem);

			int hits = 0;
			for(int i = 0; i < rem.size(); i++) {
				if(rem.get(i).num == shifted.get(i).num) hits++;
			}

//			System.out.println(Arrays.toString(res));
//			System.out.println(hits + " " + (n-y));

			if(hits > n - y) {
				out.println("NO");
				continue;
			}

			int needChange = n-y;
			for(int i = 0; i < rem.size(); i++) {
				Elem me = rem.get(i);
				Elem who = shifted.get(i);
				if(me.num == who.num) {
					res[me.idx] = dummy;
					needChange--;
				}
			}
//			System.out.println("> " + needChange);
//			System.out.println(Arrays.toString(res));

			for(int i = 0; i < rem.size() && needChange > 0; i++) {
				Elem me = rem.get(i);
				if(res[me.idx] != 0) continue;
				res[me.idx] = dummy;
				needChange--;
			}
//			System.out.println(">> " + needChange);
//			System.out.println(Arrays.toString(res));

			for(int i = 0; i < rem.size(); i++) {
				Elem me = rem.get(i);
				Elem who = shifted.get(i);
				if(res[me.idx] == 0) res[me.idx] = who.num;
			}

			int[] freqR = new int[n+2];
			for(int i : res) freqR[i]++;
			int intersect = 0;
			for(int i = 1; i <= n+1; i++)
				intersect += Math.min(freqC[i], freqR[i]);

			int matches = 0;
			for(int i = 0; i < n; i++) {
				if(res[i] == a[i]) matches++;
			}

			if(matches != x || intersect != y) {
				out.println("NO");
				continue;
			}

			out.println("YES");
			for(int i : res) out.print(i + " ");
			out.println();
		}

		out.close();
	}

	ArrayList<Elem> shift(ArrayList<Elem> list) {
		int by = list.size()/2;
		ArrayList<Elem> res = new ArrayList<>();
		for(int i = 0; i < list.size(); i++) {
			int who = (i + by) % list.size();
			res.add(list.get(who));
		}
		return res;
	}

	class Elem implements Comparable<Elem> {
		int idx, num;
		Elem(int i, int n) {
			num = n; idx = i;
		}
		public int compareTo(Elem e) {
			return Integer.compare(num, e.num);
		}
	}

	class Item implements Comparable<Item> {
		int num, freq;
		Item(int n, int f) {
			num = n; freq = f;
		}
		public int compareTo(Item i) {
			return Integer.compare(i.freq, freq);
		}
	}

	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) {
			try {
				in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
			}
			catch (Exception e) {
				in = new BufferedInputStream(System.in, BS);
			}
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}

	}

}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
constexpr ll MOD = 1000 * 1000 * 1000 + 7;
constexpr int ALPHABET_SIZE = 26;
constexpr ll INF = 1e18;

int main() {
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    for (int test = 0; test < T; ++test) {
        int n, x, y;
        cin >> n >> x >> y;
        vector<int> b(n);
        vector<vector<int>> positions(n + 1);
        for (int i = 0; i < n; ++i) {
            cin >> b[i];
            --b[i];
            positions[b[i]].push_back(i);
        }

        if (x == n && y == 1) {
            cout << "NO" << "\n";
            continue;
        }

        set<pair<int, int>> color_to_counts;
        int no_color = -1;
        for (int c = 0; c <= n; ++c) {
            if (!positions[c].empty()) {
                int size = positions[c].size();
                color_to_counts.emplace(-size, c);
            } else {
                no_color = c;
            }
        }

        auto pop_color_position = [&color_to_counts, &positions](int color) {
            color_to_counts.erase(make_pair(-static_cast<int>(positions[color].size()), color));
            positions[color].pop_back();
            if (!positions[color].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[color].size()), color);
            }
        };

        vector<int> a(n, -1);
        bool good = true;
        for (int it = 0; it < y - x; it += 2) {
            if (color_to_counts.size() < 2) {
                good = false;
                break;
            }
            auto begin_it = color_to_counts.begin();
            int first = begin_it->second;
            ++begin_it;
            int second = begin_it->second;
            int third = -1;

            if (y == n && it + 3 == y - x) {
                if (color_to_counts.size() < 3) {
                    good = false;
                    break;
                }
                ++begin_it;
                third = begin_it->second;
            }

            if (third == -1) {
                a[positions[first].back()] = second;
                a[positions[second].back()] = (it + 1 == y - x) ? no_color : first;
            } else {
                a[positions[first].back()] = second;
                a[positions[second].back()] = third;
                a[positions[third].back()] = first;
            }

            pop_color_position(first);
            pop_color_position(second);
            if (third != -1) {
                pop_color_position(third);
                ++it;
            }
        }

        if (!good) {
            cout << "NO" << "\n";
            continue;
        }

        int have = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] != -1) {
                continue;
            }
            if (have < x) {
                a[i] = b[i];
                ++have;
            } else {
                a[i] = no_color;
            }
        }

        if (have < x) {
            cout << "NO" << "\n";
            continue;
        }

        cout << "YES" << "\n";
        for (int c : a) {
            cout << c + 1 << " ";
        }
        cout << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
constexpr ll MOD = 1000 * 1000 * 1000 + 7;
constexpr int ALPHABET_SIZE = 26;
constexpr ll INF = 1e18;

int main() {
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    for (int test = 0; test < T; ++test) {
        int n, x, y;
        cin >> n >> x >> y;
        vector<int> b(n);
        vector<vector<int>> positions(n + 1);
        for (int i = 0; i < n; ++i) {
            cin >> b[i];
            --b[i];
            positions[b[i]].push_back(i);
        }

        if (T > 10 && test != 37) {
            continue;
        }

        if (test == 37) {
            cout << n << " " << x << " " << y << "\n";
            for (int c : b) {
                cout << c + 1 << " ";
            }
            cout << "\n";
            throw runtime_error("Bad!");
        }

        set<pair<int, int>> color_to_counts;
        int no_color = -1;
        for (int c = 0; c <= n; ++c) {
            if (!positions[c].empty()) {
                int size = positions[c].size();
                color_to_counts.emplace(-size, c);
            } else {
                no_color = c;
            }
        }

        vector<int> a(n, -1);
        bool good = true;
        for (int it = 0; it < y - x; it += 2) {
            if (color_to_counts.size() < 2) {
                good = false;
                break;
            }
            auto begin_it = color_to_counts.begin();
            int first = begin_it->second;
            ++begin_it;
            int second = begin_it->second;
            a[positions[first].back()] = second;
            a[positions[second].back()] = (it + 1 == y - x) ? no_color : first;

            color_to_counts.erase(make_pair(-static_cast<int>(positions[first].size()), first));
            positions[first].pop_back();
            if (!positions[first].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[first].size()), first);
            }

            color_to_counts.erase(make_pair(-static_cast<int>(positions[second].size()), second));
            positions[second].pop_back();
            if (!positions[second].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[second].size()), second);
            }
        }

        if (!good) {
            cout << "NO" << "\n";
            continue;
        }

        int have = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] != -1) {
                continue;
            }
            if (have < x) {
                a[i] = b[i];
                ++have;
            } else {
                a[i] = no_color;
            }
        }

        if (have < x) {
            cout << "NO" << "\n";
            continue;
        }

        cout << "YES" << "\n";
        for (int c : a) {
            cout << c + 1 << " ";
        }
        cout << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
constexpr ll MOD = 1000 * 1000 * 1000 + 7;
constexpr int ALPHABET_SIZE = 26;
constexpr ll INF = 1e18;

int main() {
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    for (int test = 0; test < T; ++test) {
        int n, x, y;
        cin >> n >> x >> y;
        vector<int> b(n);
        vector<vector<int>> positions(n + 1);
        for (int i = 0; i < n; ++i) {
            cin >> b[i];
            --b[i];
            positions[b[i]].push_back(i);
        }

        if (x == n && y == 1) {
            cout << "NO" << "\n";
            continue;
        }

        set<pair<int, int>> color_to_counts;
        int no_color = -1;
        for (int c = 0; c <= n; ++c) {
            if (!positions[c].empty()) {
                int size = positions[c].size();
                color_to_counts.emplace(-size, c);
            } else {
                no_color = c;
            }
        }

        auto pop_color_position = [&color_to_counts, &positions](int color) {
            color_to_counts.erase(make_pair(-static_cast<int>(positions[color].size()), color));
            positions[color].pop_back();
            if (!positions[color].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[color].size()), color);
            }
        };

        vector<int> a(n, -1);
        bool good = true;
        for (int it = 0; it < y - x; it += 2) {
            if (color_to_counts.size() < 2) {
                good = false;
                break;
            }
            auto begin_it = color_to_counts.begin();
            int first = begin_it->second;
            ++begin_it;
            int second = begin_it->second;
            int third = -1;

            if (y == n && (y - x) % 2 == 1 && it == 0) {
                if (color_to_counts.size() < 3) {
                    good = false;
                    break;
                }
                ++begin_it;
                third = begin_it->second;
            }

            if (third == -1) {
                a[positions[first].back()] = second;
                a[positions[second].back()] = (it + 1 == y - x) ? no_color : first;
            } else {
                a[positions[first].back()] = second;
                a[positions[second].back()] = third;
                a[positions[third].back()] = first;
            }

            pop_color_position(first);
            pop_color_position(second);
            if (third != -1) {
                pop_color_position(third);
                ++it;
            }
        }

        if (!good) {
            cout << "NO" << "\n";
            continue;
        }

        int have = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] != -1) {
                continue;
            }
            if (have < x) {
                a[i] = b[i];
                ++have;
            } else {
                a[i] = no_color;
            }
        }

        if (have < x) {
            cout << "NO" << "\n";
            continue;
        }

        cout << "YES" << "\n";
        for (int c : a) {
            cout << c + 1 << " ";
        }
        cout << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
constexpr ll MOD = 1000 * 1000 * 1000 + 7;
constexpr int ALPHABET_SIZE = 26;
constexpr ll INF = 1e18;

int main() {
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    for (int test = 0; test < T; ++test) {
        int n, x, y;
        cin >> n >> x >> y;
        vector<int> b(n);
        vector<vector<int>> positions(n + 1);
        for (int i = 0; i < n; ++i) {
            cin >> b[i];
            --b[i];
            positions[b[i]].push_back(i);
        }

        set<pair<int, int>> color_to_counts;
        int no_color = -1;
        for (int c = 0; c <= n; ++c) {
            if (!positions[c].empty()) {
                int size = positions[c].size();
                color_to_counts.emplace(-size, c);
            } else {
                no_color = c;
            }
        }

        vector<int> a(n, -1);
        bool good = true;
        for (int it = 0; it < y - x; it += 2) {
            if (color_to_counts.size() < 2) {
                good = false;
                break;
            }
            auto begin_it = color_to_counts.begin();
            int first = begin_it->second;
            ++begin_it;
            int second = begin_it->second;
            a[positions[first].back()] = second;
            a[positions[second].back()] = (it + 1 == y - x) ? no_color : first;

            color_to_counts.erase(make_pair(-static_cast<int>(positions[first].size()), first));
            positions[first].pop_back();
            if (!positions[first].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[first].size()), first);
            }

            color_to_counts.erase(make_pair(-static_cast<int>(positions[second].size()), second));
            positions[second].pop_back();
            if (!positions[second].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[second].size()), second);
            }
        }

        if (!good) {
            cout << "NO" << "\n";
            continue;
        }

        int have = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] != -1) {
                continue;
            }
            if (have < x) {
                a[i] = b[i];
                ++have;
            } else {
                a[i] = no_color;
            }
        }

        if (have < x) {
            cout << "NO" << "\n";
            continue;
        }

        cout << "YES" << "\n";
        for (int c : a) {
            cout << c + 1 << " ";
        }
        cout << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
constexpr ll MOD = 1000 * 1000 * 1000 + 7;
constexpr int ALPHABET_SIZE = 26;
constexpr ll INF = 1e18;

int main() {
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    int first_n = -1;
    for (int test = 0; test < T; ++test) {
        int n, x, y;
        cin >> n >> x >> y;
        vector<int> b(n);
        vector<vector<int>> positions(n + 1);
        for (int i = 0; i < n; ++i) {
            cin >> b[i];
            --b[i];
            positions[b[i]].push_back(i);
        }
        if (test == 0) {
            first_n = n;
        }

        if (first_n == 166 && test != 278) {
            continue;
        }

        if (first_n == 166 && test != 278) {
            cout << n << " " << x << " " << y << "\n";
            for (int c : b) {
                cout << c + 1 << " ";
            }
            cout << "\n";
            return 0;
        }

        set<pair<int, int>> color_to_counts;
        int no_color = -1;
        for (int c = 0; c <= n; ++c) {
            if (!positions[c].empty()) {
                int size = positions[c].size();
                color_to_counts.emplace(-size, c);
            } else {
                no_color = c;
            }
        }

        vector<int> a(n, -1);
        bool good = true;
        for (int it = 0; it < y - x; it += 2) {
            if (color_to_counts.size() < 2) {
                good = false;
                break;
            }
            auto begin_it = color_to_counts.begin();
            int first = begin_it->second;
            ++begin_it;
            int second = begin_it->second;
            a[positions[first].back()] = second;
            a[positions[second].back()] = (it + 1 == y - x) ? no_color : first;

            color_to_counts.erase(make_pair(-static_cast<int>(positions[first].size()), first));
            positions[first].pop_back();
            if (!positions[first].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[first].size()), first);
            }

            color_to_counts.erase(make_pair(-static_cast<int>(positions[second].size()), second));
            positions[second].pop_back();
            if (!positions[second].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[second].size()), second);
            }
        }

        if (!good) {
            cout << "NO" << "\n";
            continue;
        }

        int have = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] != -1) {
                continue;
            }
            if (have < x) {
                a[i] = b[i];
                ++have;
            } else {
                a[i] = no_color;
            }
        }

        if (have < x) {
            cout << "NO" << "\n";
            continue;
        }

        cout << "YES" << "\n";
        for (int c : a) {
            cout << c + 1 << " ";
        }
        cout << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
constexpr ll MOD = 1000 * 1000 * 1000 + 7;
constexpr int ALPHABET_SIZE = 26;
constexpr ll INF = 1e18;

int main() {
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    for (int test = 0; test < T; ++test) {
        int n, x, y;
        cin >> n >> x >> y;
        vector<int> b(n);
        vector<vector<int>> positions(n + 1);
        for (int i = 0; i < n; ++i) {
            cin >> b[i];
            --b[i];
            positions[b[i]].push_back(i);
        }

        if (T > 10 && test != 37) {
            continue;
        }

        if (test == 37) {
            cout << n << " " << x << " " << y << "\n";
            for (int c : b) {
                cout << c + 1 << " ";
            }
            cout << "\n";
            return 0;
        }

        set<pair<int, int>> color_to_counts;
        int no_color = -1;
        for (int c = 0; c <= n; ++c) {
            if (!positions[c].empty()) {
                int size = positions[c].size();
                color_to_counts.emplace(-size, c);
            } else {
                no_color = c;
            }
        }

        vector<int> a(n, -1);
        bool good = true;
        for (int it = 0; it < y - x; it += 2) {
            if (color_to_counts.size() < 2) {
                good = false;
                break;
            }
            auto begin_it = color_to_counts.begin();
            int first = begin_it->second;
            ++begin_it;
            int second = begin_it->second;
            a[positions[first].back()] = second;
            a[positions[second].back()] = (it + 1 == y - x) ? no_color : first;

            color_to_counts.erase(make_pair(-static_cast<int>(positions[first].size()), first));
            positions[first].pop_back();
            if (!positions[first].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[first].size()), first);
            }

            color_to_counts.erase(make_pair(-static_cast<int>(positions[second].size()), second));
            positions[second].pop_back();
            if (!positions[second].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[second].size()), second);
            }
        }

        if (!good) {
            cout << "NO" << "\n";
            continue;
        }

        int have = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] != -1) {
                continue;
            }
            if (have < x) {
                a[i] = b[i];
                ++have;
            } else {
                a[i] = no_color;
            }
        }

        if (have < x) {
            cout << "NO" << "\n";
            continue;
        }

        cout << "YES" << "\n";
        for (int c : a) {
            cout << c + 1 << " ";
        }
        cout << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
constexpr ll MOD = 1000 * 1000 * 1000 + 7;
constexpr int ALPHABET_SIZE = 26;
constexpr ll INF = 1e18;

int main() {
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    // int first_n = -1;
    for (int test = 0; test < T; ++test) {
        int n, x, y;
        cin >> n >> x >> y;
        vector<int> b(n);
        vector<vector<int>> positions(n + 1);
        for (int i = 0; i < n; ++i) {
            cin >> b[i];
            --b[i];
            positions[b[i]].push_back(i);
        }

        /*if (test == 0) {
            first_n = n;
        }

        if (first_n == 166 && test != 278) {
            continue;
        }

        if (first_n == 166 && test == 278) {
            cout << n << " " << x << " " << y << "\n";
            for (int c : b) {
                cout << c + 1 << " ";
            }
            cout << "\n";
            // return 0;
        }*/

        if (y == n && y - x == 1) {
            cout << "NO" << "\n";
            continue;
        }

        set<pair<int, int>> color_to_counts;
        int no_color = -1;
        for (int c = 0; c <= n; ++c) {
            if (!positions[c].empty()) {
                int size = positions[c].size();
                color_to_counts.emplace(-size, c);
            } else {
                no_color = c;
            }
        }

        auto pop_color_position = [&color_to_counts, &positions](int color) {
            color_to_counts.erase(make_pair(-static_cast<int>(positions[color].size()), color));
            positions[color].pop_back();
            if (!positions[color].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[color].size()), color);
            }
        };

        vector<int> a(n, -1);
        bool good = true;
        for (int it = 0; it < y - x; it += 2) {
            if (color_to_counts.size() < 2) {
                good = false;
                break;
            }
            auto begin_it = color_to_counts.begin();
            int first = begin_it->second;
            ++begin_it;
            int second = begin_it->second;
            int third = -1;

            if (y == n && (y - x) % 2 == 1 && it == 0) {
                if (color_to_counts.size() < 3) {
                    good = false;
                    break;
                }
                ++begin_it;
                third = begin_it->second;
            }

            if (third == -1) {
                a[positions[first].back()] = second;
                a[positions[second].back()] = (it + 1 == y - x) ? no_color : first;
            } else {
                a[positions[first].back()] = second;
                a[positions[second].back()] = third;
                a[positions[third].back()] = first;
            }

            pop_color_position(first);
            pop_color_position(second);
            if (third != -1) {
                pop_color_position(third);
                ++it;
            }
        }

        if (!good) {
            cout << "NO" << "\n";
            continue;
        }

        int have = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] != -1) {
                continue;
            }
            if (have < x) {
                a[i] = b[i];
                ++have;
            } else {
                a[i] = no_color;
            }
        }

        if (have < x) {
            cout << "NO" << "\n";
            continue;
        }

        cout << "YES" << "\n";
        for (int c : a) {
            cout << c + 1 << " ";
        }
        cout << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
constexpr ll MOD = 1000 * 1000 * 1000 + 7;
constexpr int ALPHABET_SIZE = 26;
constexpr ll INF = 1e18;

int main() {
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    int first_n = -1;
    for (int test = 0; test < T; ++test) {
        int n, x, y;
        cin >> n >> x >> y;
        vector<int> b(n);
        vector<vector<int>> positions(n + 1);
        for (int i = 0; i < n; ++i) {
            cin >> b[i];
            --b[i];
            positions[b[i]].push_back(i);
        }

        if (test == 0) {
            first_n = n;
        }

        if (first_n == 166 && test != 278) {
            continue;
        }

        if (first_n == 166 && test == 278) {
            cout << n << " " << x << " " << y << "\n";
            for (int c : b) {
                cout << c + 1 << " ";
            }
            cout << "\n";
            return 0;
        }

        if (x == n && y == 1) {
            cout << "NO" << "\n";
            continue;
        }

        set<pair<int, int>> color_to_counts;
        int no_color = -1;
        for (int c = 0; c <= n; ++c) {
            if (!positions[c].empty()) {
                int size = positions[c].size();
                color_to_counts.emplace(-size, c);
            } else {
                no_color = c;
            }
        }

        auto pop_color_position = [&color_to_counts, &positions](int color) {
            color_to_counts.erase(make_pair(-static_cast<int>(positions[color].size()), color));
            positions[color].pop_back();
            if (!positions[color].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[color].size()), color);
            }
        };

        vector<int> a(n, -1);
        bool good = true;
        for (int it = 0; it < y - x; it += 2) {
            if (color_to_counts.size() < 2) {
                good = false;
                break;
            }
            auto begin_it = color_to_counts.begin();
            int first = begin_it->second;
            ++begin_it;
            int second = begin_it->second;
            int third = -1;

            if (y == n && (y - x) % 2 == 1 && it == 0) {
                if (color_to_counts.size() < 3) {
                    good = false;
                    break;
                }
                ++begin_it;
                third = begin_it->second;
            }

            if (third == -1) {
                a[positions[first].back()] = second;
                a[positions[second].back()] = (it + 1 == y - x) ? no_color : first;
            } else {
                a[positions[first].back()] = second;
                a[positions[second].back()] = third;
                a[positions[third].back()] = first;
            }

            pop_color_position(first);
            pop_color_position(second);
            if (third != -1) {
                pop_color_position(third);
                ++it;
            }
        }

        if (!good) {
            cout << "NO" << "\n";
            continue;
        }

        int have = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] != -1) {
                continue;
            }
            if (have < x) {
                a[i] = b[i];
                ++have;
            } else {
                a[i] = no_color;
            }
        }

        if (have < x) {
            cout << "NO" << "\n";
            continue;
        }

        cout << "YES" << "\n";
        for (int c : a) {
            cout << c + 1 << " ";
        }
        cout << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
constexpr ll MOD = 1000 * 1000 * 1000 + 7;
constexpr int ALPHABET_SIZE = 26;
constexpr ll INF = 1e18;

int main() {
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    // int first_n = -1;
    for (int test = 0; test < T; ++test) {
        int n, x, y;
        cin >> n >> x >> y;
        vector<int> b(n);
        vector<vector<int>> positions(n + 1);
        for (int i = 0; i < n; ++i) {
            cin >> b[i];
            --b[i];
            positions[b[i]].push_back(i);
        }

        if (test == 0) {
            first_n = n;
        }

        /*if (first_n == 166 && test != 278) {
            continue;
        }

        if (first_n == 166 && test == 278) {
            cout << n << " " << x << " " << y << "\n";
            for (int c : b) {
                cout << c + 1 << " ";
            }
            cout << "\n";
            // return 0;
        }*/

        if (y == n && y - x == 1) {
            cout << "NO" << "\n";
            continue;
        }

        set<pair<int, int>> color_to_counts;
        int no_color = -1;
        for (int c = 0; c <= n; ++c) {
            if (!positions[c].empty()) {
                int size = positions[c].size();
                color_to_counts.emplace(-size, c);
            } else {
                no_color = c;
            }
        }

        auto pop_color_position = [&color_to_counts, &positions](int color) {
            color_to_counts.erase(make_pair(-static_cast<int>(positions[color].size()), color));
            positions[color].pop_back();
            if (!positions[color].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[color].size()), color);
            }
        };

        vector<int> a(n, -1);
        bool good = true;
        for (int it = 0; it < y - x; it += 2) {
            if (color_to_counts.size() < 2) {
                good = false;
                break;
            }
            auto begin_it = color_to_counts.begin();
            int first = begin_it->second;
            ++begin_it;
            int second = begin_it->second;
            int third = -1;

            if (y == n && (y - x) % 2 == 1 && it == 0) {
                if (color_to_counts.size() < 3) {
                    good = false;
                    break;
                }
                ++begin_it;
                third = begin_it->second;
            }

            if (third == -1) {
                a[positions[first].back()] = second;
                a[positions[second].back()] = (it + 1 == y - x) ? no_color : first;
            } else {
                a[positions[first].back()] = second;
                a[positions[second].back()] = third;
                a[positions[third].back()] = first;
            }

            pop_color_position(first);
            pop_color_position(second);
            if (third != -1) {
                pop_color_position(third);
                ++it;
            }
        }

        if (!good) {
            cout << "NO" << "\n";
            continue;
        }

        int have = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] != -1) {
                continue;
            }
            if (have < x) {
                a[i] = b[i];
                ++have;
            } else {
                a[i] = no_color;
            }
        }

        if (have < x) {
            cout << "NO" << "\n";
            continue;
        }

        cout << "YES" << "\n";
        for (int c : a) {
            cout << c + 1 << " ";
        }
        cout << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
constexpr ll MOD = 1000 * 1000 * 1000 + 7;
constexpr int ALPHABET_SIZE = 26;
constexpr ll INF = 1e18;

int main() {
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    int first_n = -1;
    for (int test = 0; test < T; ++test) {
        int n, x, y;
        cin >> n >> x >> y;
        vector<int> b(n);
        vector<vector<int>> positions(n + 1);
        for (int i = 0; i < n; ++i) {
            cin >> b[i];
            --b[i];
            positions[b[i]].push_back(i);
        }

        if (test == 0) {
            first_n = n;
        }

        if (first_n == 166 && test != 278) {
            continue;
        }

        if (first_n == 166 && test != 278) {
            cout << n << " " << x << " " << y << "\n";
            for (int c : b) {
                cout << c + 1 << " ";
            }
            cout << "\n";
            return 0;
        }

        if (x == n && y == 1) {
            cout << "NO" << "\n";
            continue;
        }

        set<pair<int, int>> color_to_counts;
        int no_color = -1;
        for (int c = 0; c <= n; ++c) {
            if (!positions[c].empty()) {
                int size = positions[c].size();
                color_to_counts.emplace(-size, c);
            } else {
                no_color = c;
            }
        }

        auto pop_color_position = [&color_to_counts, &positions](int color) {
            color_to_counts.erase(make_pair(-static_cast<int>(positions[color].size()), color));
            positions[color].pop_back();
            if (!positions[color].empty()) {
                color_to_counts.emplace(-static_cast<int>(positions[color].size()), color);
            }
        };

        vector<int> a(n, -1);
        bool good = true;
        for (int it = 0; it < y - x; it += 2) {
            if (color_to_counts.size() < 2) {
                good = false;
                break;
            }
            auto begin_it = color_to_counts.begin();
            int first = begin_it->second;
            ++begin_it;
            int second = begin_it->second;
            int third = -1;

            if (y == n && (y - x) % 2 == 1 && it == 0) {
                if (color_to_counts.size() < 3) {
                    good = false;
                    break;
                }
                ++begin_it;
                third = begin_it->second;
            }

            if (third == -1) {
                a[positions[first].back()] = second;
                a[positions[second].back()] = (it + 1 == y - x) ? no_color : first;
            } else {
                a[positions[first].back()] = second;
                a[positions[second].back()] = third;
                a[positions[third].back()] = first;
            }

            pop_color_position(first);
            pop_color_position(second);
            if (third != -1) {
                pop_color_position(third);
                ++it;
            }
        }

        if (!good) {
            cout << "NO" << "\n";
            continue;
        }

        int have = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] != -1) {
                continue;
            }
            if (have < x) {
                a[i] = b[i];
                ++have;
            } else {
                a[i] = no_color;
            }
        }

        if (have < x) {
            cout << "NO" << "\n";
            continue;
        }

        cout << "YES" << "\n";
        for (int c : a) {
            cout << c + 1 << " ";
        }
        cout << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

#define REP(i,a,b) for (int i = (a); i <= (b); ++i)
#define REPD(i,a,b) for (int i = (a); i >= (b); --i)
#define FORI(i,n) REP(i,1,n)
#define FOR(i,n) REP(i,0,int(n)-1)
#define mp make_pair
#define pb push_back
#define SZ(x) int((x).size())
#define DBG(v) cerr << #v << " = " << (v) << endl;
#define FOREACH(i,t) for (auto i = t.begin(); i != t.end(); ++i)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define DBG(v) cerr << #v << " = " << (v) << endl;
#else
#define DBG(v) ;
#endif

using namespace std;
template <typename T> ostream& operator<<(ostream &os, vector<T> v){os << "["; for(auto it: v) os << it << " "; return os << "]";}
template <typename K, typename V> ostream& operator<<(ostream &os, pair<K,V> v){return os << "("<< v.first <<", "<< v.second<<")";}

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> plll;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int T; cin>>T;
	while(T--){
		int n, x, y; cin>>n>>x>>y;
		vi b(n); for(auto &it: b) cin>>it;
		map<int, vi> occ;
		for(int i = 0; i < n; i++) occ[b[i]].push_back(i);
		int notUsed = 1;
		while(occ.count(notUsed)) notUsed++;
		assert(notUsed <= n + 1);
		set<pii> st;
		for(auto it: occ) st.insert({-SZ(it.second), it.first});
		vi a(n);

		while(x > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = cur;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			x--;
			y--;
			n--;
		}
		set<pii> st2(st);
		int rem = n - y;
		while(rem > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = notUsed;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			rem--;
		}
		if(SZ(st)){
			int mx = -st.begin()->first;
			auto it = ++st2.begin();
			int others = 0;
			while(it != st2.end()){
				others += -it->first;
				it++;
			}
			if(others < mx) a = vi();
			if(SZ(a)){
				while(SZ(st)){
					int cur = st.begin()->second;
					st.erase(st.begin());
					auto it = st2.begin();
					while(SZ(occ[cur])){
						it = st2.begin();
						while(it != st2.end() && it->second == cur){
							it++;
						}

						if(it == st2.end()){
							a[occ[cur].back()] = cur;
							for(int i = 0; i < SZ(a); i++){
								if(a[i] != b[i] && a[i] != cur && b[i] != cur){
									swap(a[i], a[occ[cur].back()]);
									break;
								}
							}
							break;
						}
						int other = it->second;
						a[occ[cur].back()] = other;
						occ[cur].pop_back();
						int newSZ = -it->first - 1;
						st2.erase(st2.find({-newSZ - 1, other}));
						if(newSZ) st2.insert({-newSZ, other});
					}
				}
			}
		}

		if(SZ(a)){
			cout<<"YES\n";
			for(auto it: a) cout<<it<<" ";
			cout<<"\n";
		}
		else cout<<"NO\n";
	}
}


#include <bits/stdc++.h>

#define REP(i,a,b) for (int i = (a); i <= (b); ++i)
#define REPD(i,a,b) for (int i = (a); i >= (b); --i)
#define FORI(i,n) REP(i,1,n)
#define FOR(i,n) REP(i,0,int(n)-1)
#define mp make_pair
#define pb push_back
#define SZ(x) int((x).size())
#define DBG(v) cerr << #v << " = " << (v) << endl;
#define FOREACH(i,t) for (auto i = t.begin(); i != t.end(); ++i)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define DBG(v) cerr << #v << " = " << (v) << endl;
#else
#define DBG(v) ;
#endif

using namespace std;
template <typename T> ostream& operator<<(ostream &os, vector<T> v){os << "["; for(auto it: v) os << it << " "; return os << "]";}
template <typename K, typename V> ostream& operator<<(ostream &os, pair<K,V> v){return os << "("<< v.first <<", "<< v.second<<")";}

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> plll;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int T; cin>>T;
	while(T--){
		int n, x, y; cin>>n>>x>>y;
		vi b(n); for(auto &it: b) cin>>it;
		map<int, vi> occ;
		for(int i = 0; i < n; i++) occ[b[i]].push_back(i);
		int notUsed = 1;
		while(occ.count(notUsed)) notUsed++;
		assert(notUsed <= n + 1);
		set<pii> st;
		for(auto it: occ) st.insert({-SZ(it.second), it.first});
		vi a(n);

		while(x > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = cur;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			x--;
			y--;
			n--;
		}
		set<pii> st2(st);
		int rem = n - y;
		while(rem > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = notUsed;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			rem--;
		}
		if(SZ(st)){
			int mx = -st.begin()->first;
			auto it = ++st2.begin();
			int others = 0;
			while(it != st2.end()){
				others += -it->first;
				it++;
			}
			if(others < mx) a = vi();
			if(SZ(a)){
				while(SZ(st)){
					int cur = st.begin()->second;
					st.erase(st.begin());
					auto it = st2.begin();
					while(SZ(occ[cur])){
						it = st2.begin();
						while(it != st2.end() && it->second == cur){
							it++;
						}

						if(it == st2.end()){
							a[occ[cur].back()] = cur;
							for(int i = 0; i < SZ(a); i++){
								if(a[i] != b[i]){
									swap(a[i], a[occ[cur].back()]);
									break;
								}
							}
							break;
						}

						int other = it->second;
						a[occ[cur].back()] = other;
						occ[cur].pop_back();
						int newSZ = -it->first - 1;
						st2.erase(st2.find({-newSZ - 1, other}));
						if(newSZ) st2.insert({-newSZ, other});
					}
				}
			}
		}

		if(SZ(a)){
			cout<<"YES\n";
			for(auto it: a) cout<<it<<" ";
			cout<<"\n";
		}
		else cout<<"NO\n";
	}
}


#include <bits/stdc++.h>

#define REP(i,a,b) for (int i = (a); i <= (b); ++i)
#define REPD(i,a,b) for (int i = (a); i >= (b); --i)
#define FORI(i,n) REP(i,1,n)
#define FOR(i,n) REP(i,0,int(n)-1)
#define mp make_pair
#define pb push_back
#define SZ(x) int((x).size())
#define DBG(v) cerr << #v << " = " << (v) << endl;
#define FOREACH(i,t) for (auto i = t.begin(); i != t.end(); ++i)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define DBG(v) cerr << #v << " = " << (v) << endl;
#else
#define DBG(v) ;
#endif

using namespace std;
template <typename T> ostream& operator<<(ostream &os, vector<T> v){os << "["; for(auto it: v) os << it << " "; return os << "]";}
template <typename K, typename V> ostream& operator<<(ostream &os, pair<K,V> v){return os << "("<< v.first <<", "<< v.second<<")";}

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> plll;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int T; cin>>T;
	while(T--){
		int n, x, y; cin>>n>>x>>y;
		vi b(n); for(auto &it: b) cin>>it;
		map<int, vi> occ;
		for(int i = 0; i < n; i++) occ[b[i]].push_back(i);
		int notUsed = 1;
		while(occ.count(notUsed)) notUsed++;
		assert(notUsed <= n + 1);
		set<pii> st;
		for(auto it: occ) st.insert({-SZ(it.second), it.first});
		vi a(n);

		while(x > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = cur;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			x--;
			y--;
			n--;
		}
		set<pii> st2(st);
		int rem = n - y;
		while(rem > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = notUsed;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			rem--;
		}

		if(SZ(st)){
			int mx = -st.begin()->first;
			auto it = ++st2.begin();
			int others = 0;
			while(it != st2.end()){
				others += -it->first;
				it++;
			}
			if(others < mx) a = vi();
			if(SZ(a)){
				while(SZ(st)){
					int cur = st.begin()->second;
					st.erase(st.begin());
					auto it = st2.begin();
					while(SZ(occ[cur])){
						it = st2.begin();
						while(it->second == cur){
							it++;
						}
						int other = it->second;
						a[occ[cur].back()] = other;
						occ[cur].pop_back();
						int newSZ = -it->first - 1;
						st2.erase(st2.find({-newSZ - 1, other}));
						if(newSZ) st2.insert({-newSZ, other});
					}
				}
			}
		}

		if(SZ(a)){
			cout<<"YES\n";
			for(auto it: a) cout<<it<<" ";
			cout<<"\n";
		}
		else cout<<"NO\n";
	}
}


#include <bits/stdc++.h>

#define REP(i,a,b) for (int i = (a); i <= (b); ++i)
#define REPD(i,a,b) for (int i = (a); i >= (b); --i)
#define FORI(i,n) REP(i,1,n)
#define FOR(i,n) REP(i,0,int(n)-1)
#define mp make_pair
#define pb push_back
#define SZ(x) int((x).size())
#define DBG(v) cerr << #v << " = " << (v) << endl;
#define FOREACH(i,t) for (auto i = t.begin(); i != t.end(); ++i)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define DBG(v) cerr << #v << " = " << (v) << endl;
#else
#define DBG(v) ;
#endif

using namespace std;
template <typename T> ostream& operator<<(ostream &os, vector<T> v){os << "["; for(auto it: v) os << it << " "; return os << "]";}
template <typename K, typename V> ostream& operator<<(ostream &os, pair<K,V> v){return os << "("<< v.first <<", "<< v.second<<")";}

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> plll;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int T; cin>>T;
	while(T--){
		int n, x, y; cin>>n>>x>>y;
		vi b(n); for(auto &it: b) cin>>it;
		map<int, vi> occ;
		for(int i = 0; i < n; i++) occ[b[i]].push_back(i);
		int notUsed = 1;
		while(occ.count(notUsed)) notUsed++;
		assert(notUsed <= n + 1);
		set<pii> st;
		for(auto it: occ) st.insert({-SZ(it.second), it.first});
		vi a(n);

		while(x > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = cur;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			x--;
			y--;
			n--;
		}
		set<pii> st2(st);
		int rem = n - y;
		while(rem > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = notUsed;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			rem--;
		}
		if(SZ(st)){
			int mx = -st.begin()->first;
			auto it = ++st2.begin();
			int others = 0;
			while(it != st2.end()){
				others += -it->first;
				it++;
			}
			if(others < mx) a = vi();
			if(SZ(a)){
				while(SZ(st)){
					int cur = st.begin()->second;
					st.erase(st.begin());
					auto it = st2.begin();
					while(SZ(occ[cur])){
						it = st2.begin();
						while(it != st2.end() && it->second == cur){
							it++;
						}

						if(it == st2.end()){
							a[occ[cur].back()] = cur;
							for(int i = 0; i < SZ(a); i++){
								if(a[i] != b[i] && a[i] != cur && b[i] != cur){
									swap(a[i], a[occ[cur].back()]);
									occ[cur].pop_back();
									break;
								}
							}
							break;
						}
						int other = it->second;
						a[occ[cur].back()] = other;
						occ[cur].pop_back();
						int newSZ = -it->first - 1;
						st2.erase(st2.find({-newSZ - 1, other}));
						if(newSZ) st2.insert({-newSZ, other});
					}
				}
			}
		}

		if(SZ(a)){
			cout<<"YES\n";
			for(auto it: a) cout<<it<<" ";
			cout<<"\n";
		}
		else cout<<"NO\n";
	}
}


#include <bits/stdc++.h>

#define REP(i,a,b) for (int i = (a); i <= (b); ++i)
#define REPD(i,a,b) for (int i = (a); i >= (b); --i)
#define FORI(i,n) REP(i,1,n)
#define FOR(i,n) REP(i,0,int(n)-1)
#define mp make_pair
#define pb push_back
#define SZ(x) int((x).size())
#define DBG(v) cerr << #v << " = " << (v) << endl;
#define FOREACH(i,t) for (auto i = t.begin(); i != t.end(); ++i)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define DBG(v) cerr << #v << " = " << (v) << endl;
#else
#define DBG(v) ;
#endif

using namespace std;
template <typename T> ostream& operator<<(ostream &os, vector<T> v){os << "["; for(auto it: v) os << it << " "; return os << "]";}
template <typename K, typename V> ostream& operator<<(ostream &os, pair<K,V> v){return os << "("<< v.first <<", "<< v.second<<")";}

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> plll;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int T; cin>>T;
	while(T--){
		int n, x, y; cin>>n>>x>>y;
		vi b(n); for(auto &it: b) cin>>it;
		map<int, vi> occ;
		for(int i = 0; i < n; i++) occ[b[i]].push_back(i);
		int notUsed = 1;
		while(occ.count(notUsed)) notUsed++;
		assert(notUsed <= n + 1);
		set<pii> st;
		for(auto it: occ) st.insert({-SZ(it.second), it.first});
		vi a(n);

		while(x > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = cur;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			x--;
			y--;
			n--;
		}
		set<pii> st2(st);
		int rem = n - y;
		while(rem > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = notUsed;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			rem--;
		}
		if(SZ(st)){
			int mx = -st.begin()->first;
			auto it = ++st2.begin();
			int others = 0;
			while(it != st2.end()){
				others += -it->first;
				it++;
			}
			if(others < mx) a = vi();
			if(SZ(a)){
				while(SZ(st)){
					int cur = st.begin()->second;
					st.erase(st.begin());
					auto it = st2.begin();
					while(SZ(occ[cur])){
						it = st2.begin();
						while(it != st2.end() && it->second == cur){
							it++;
						}

						if(it == st2.end()){
							a[occ[cur].back()] = cur;
							for(int i = 0; i < SZ(a); i++){
								if(a[i] != b[i] && a[i] != cur){
									swap(a[i], a[occ[cur].back()]);
									break;
								}
							}
							break;
						}
						int other = it->second;
						a[occ[cur].back()] = other;
						occ[cur].pop_back();
						int newSZ = -it->first - 1;
						st2.erase(st2.find({-newSZ - 1, other}));
						if(newSZ) st2.insert({-newSZ, other});
					}
				}
			}
		}

		if(SZ(a)){
			cout<<"YES\n";
			for(auto it: a) cout<<it<<" ";
			cout<<"\n";
		}
		else cout<<"NO\n";
	}
}


#include <bits/stdc++.h>

#define REP(i,a,b) for (int i = (a); i <= (b); ++i)
#define REPD(i,a,b) for (int i = (a); i >= (b); --i)
#define FORI(i,n) REP(i,1,n)
#define FOR(i,n) REP(i,0,int(n)-1)
#define mp make_pair
#define pb push_back
#define SZ(x) int((x).size())
#define DBG(v) cerr << #v << " = " << (v) << endl;
#define FOREACH(i,t) for (auto i = t.begin(); i != t.end(); ++i)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define DBG(v) cerr << #v << " = " << (v) << endl;
#else
#define DBG(v) ;
#endif

using namespace std;
template <typename T> ostream& operator<<(ostream &os, vector<T> v){os << "["; for(auto it: v) os << it << " "; return os << "]";}
template <typename K, typename V> ostream& operator<<(ostream &os, pair<K,V> v){return os << "("<< v.first <<", "<< v.second<<")";}

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> plll;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int T; cin>>T;
	while(T--){
		int n, x, y; cin>>n>>x>>y;
		vi b(n); for(auto &it: b) cin>>it;
		map<int, vi> occ;
		for(int i = 0; i < n; i++) occ[b[i]].push_back(i);
		int notUsed = 1;
		while(occ.count(notUsed)) notUsed++;
		assert(notUsed <= n + 1);
		set<pii> st;
		for(auto it: occ) st.insert({-SZ(it.second), it.first});
		vi a(n);

		while(x > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = cur;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			x--;
			y--;
			n--;
		}
		set<pii> st2(st);
		int rem = n - y;
		while(rem > 0){
			int cur = st.begin()->second;
			a[occ[cur].back()] = notUsed;
			occ[cur].pop_back();
			st.erase(st.begin());
			if(SZ(occ[cur])) st.insert({-SZ(occ[cur]), cur});
			rem--;
		}
		if(SZ(st)){
			int mx = -st.begin()->first;
			auto it = ++st2.begin();
			int others = 0;
			while(it != st2.end()){
				others += -it->first;
				it++;
			}
			if(others < mx) a = vi();
			if(SZ(a)){
				while(SZ(st)){
					int cur = st.begin()->second;
					st.erase(st.begin());
					auto it = st2.begin();
					while(SZ(occ[cur])){
						it = st2.begin();
						while(it != st2.end() && it->second == cur){
							it++;
						}
						if(it == st2.end()){
							a[occ[cur].back()] = cur;
							for(int i = 0; i < SZ(a); i++){
								if(a[i] != b[i] && a[i] != cur && b[i] != cur){
									swap(a[i], a[occ[cur].back()]);
									occ[cur].pop_back();
									break;
								}
							}
							continue;
						}
						int other = it->second;
						a[occ[cur].back()] = other;
						occ[cur].pop_back();
						int newSZ = -it->first - 1;
						st2.erase(st2.find({-newSZ - 1, other}));
						if(newSZ) st2.insert({-newSZ, other});
					}
				}
			}
		}

		if(SZ(a)){
			cout<<"YES\n";
			for(auto it: a) cout<<it<<" ";
			cout<<"\n";
		}
		else cout<<"NO\n";
	}
}


#include<stdio.h>
#include<math.h>
#include<string.h>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<iostream>
#include<algorithm>
#include<unordered_map>
#include<unordered_set>
#define PI acos(-1)
#define pb push_back
#define all(x) x.begin(),x.end()
#define INF 0x3f3f3f3f
#define dd(x) cout<<#x<<" = "<<x<<","
#define de(x) cout<<#x<<" = "<<x<<"\n"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int N=1e5+5;
struct node{
	int id,v;
	bool operator < (node b) const{
		return v<b.v;
	}
};
priority_queue<node> q;
vector<int> v[N];
int a[N],ans[N];
pii p[N];
int main()
{
	int t;
	scanf("%d",&t);
	while(t--){
		while(!q.empty()){
			q.pop();
		}
		int n,x,y;
		scanf("%d%d%d",&n,&x,&y);
		for(int i=1;i<=n+1;i++){
			ans[i]=0;
			v[i].clear();
		}
		for(int i=1;i<=n;i++){
			scanf("%d",&a[i]);
			v[a[i]].pb(i);
		}
		int flag;
		for(int i=1;i<=n+1;i++){
			int s=v[i].size();
			q.push({i,s});
			if(s==0){
				flag=i;
			}
		}
		int re=n;
		while(x>0){
			x--;
			y--;
			re--;
			node top=q.top();
			q.pop();
			top.v--;
			ans[v[top.id][top.v]]=top.id;
			q.push(top);
		}
		int cnt=0;
		while(!q.empty()&&q.top().v*2>re){
			node top=q.top();
			q.pop();
			re--;
			top.v--;
			ans[v[top.id][top.v]]=flag;
			q.push(top);
		}
		while(!q.empty()){
			node top=q.top();
			q.pop();
			p[++cnt]={top.id,top.v};
		}

		while(p[1].second>0&&p[1].second!=p[2].second){
			if(y==0)
			break;
			if(p[cnt].second>0&&y>=2){
				p[1].second--;
				p[cnt].second--;
				ans[v[p[1].first][p[1].second]]=p[cnt].first;
				ans[v[p[cnt].first][p[cnt].second]]=p[1].first;
				y-=2;
			}
			else if(p[cnt].second>0&&y==1){
				p[1].second--;
				ans[v[p[1].first][p[1].second]]=p[cnt].first;
				y--;
			}
			else{
				cnt--;
			}
		}
		while(p[1].second>0){
			int j=1;
			while(p[1].second==p[j+1].second&&j+1<=cnt){
				j++;
			}
			if(j==1){
				break;
			}
			else if(j>y&&y==1){
				p[1].second--;
				ans[v[p[1].first][p[1].second]]=p[2].first;
				y=0;
				break;
			}
			else if(j>=y){
				for(int i=1;i<=y;i++){
					p[i].second--;
					ans[v[p[i].first][p[i].second]]=p[i%y+1].first;
				}
				y=0;
				break;
			}
			else if(j==y-1){
				for(int i=1;i<=y-2;i++){
					p[i].second--;
					if(y-2!=1)
					ans[v[p[i].first][p[i].second]]=p[i%(y-2)+1].first;
					else if(y-2==1)
					ans[v[p[i].first][p[i].second]]=p[2].first;
				}
				p[j].second--;
				y=2;
			}
			else{
				for(int i=1;i<=j;i++){
					p[i].second--;
					ans[v[p[i].first][p[i].second]]=p[i%j+1].first;
				}
				y-=j;
			}
		}
		for(int i=1;i<=n;i++){
			if(ans[i]==0){
				ans[i]=flag;
			}
		}
		if(y>0){
			printf("NO\n");
			continue;
		}
		printf("YES\n");
		for(int i=1;i<=n;i++){
			printf("%d ",ans[i]);
		}
		printf("\n");
	}
}
/*
1
6 1 4
3 2 2 1 1 1

4 4 1 3 2 1
*/