#include <bits/stdc++.h>
using namespace std;
struct node {
  int cnt;
  int id;
  node() {}
  node(int cnt, int id) : cnt(cnt), id(id) {}
  friend bool operator<(node x, node y) {
    return 1LL * x.cnt * (long long)1e6 + x.id <
           1LL * y.cnt * (long long)1e6 + y.id;
  }
};
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n, x, y;
    scanf("%d%d%d", &n, &x, &y);
    vector<node> tj(n + 2);
    vector<int> V(n);
    vector<vector<int> > t(n + 2);
    vector<bool> vis(n + 2);
    for (int i = 1; i <= n + 1; i++) tj[i] = node(0, i);
    for (int i = 0; i < n; i++) {
      scanf("%d", &V[i]);
      t[V[i]].push_back(i);
      tj[V[i]].cnt++;
      vis[V[i]] = true;
    }
    priority_queue<node> Q;
    for (int i = 1; i <= n + 1; i++) {
      Q.push(tj[i]);
    }
    int cs = x;
    while (cs) {
      node u = Q.top();
      Q.pop();
      node v = Q.top();
      int ycnt = u.cnt;
      u.cnt = max(v.cnt - 1, ycnt - cs);
      cs -= (ycnt - u.cnt);
      Q.push(u);
    }
    int f = Q.top().cnt;
    int minp = max(2 * f - (n - x), 0);
    if (minp > n - y) {
      printf("NO\n");
      continue;
    }
    int cnt = 0;
    vector<int> PV(n - x);
    vector<int> VS(n);
    while (Q.size()) {
      int id = Q.top().id;
      for (int i = 0; i < Q.top().cnt; i++) {
        PV[cnt++] = t[id][i];
      }
      Q.pop();
    }
    int mod = n - x;
    int q = (n - x) / 2;
    for (int i = 0; i < n - x; i++) {
      VS[PV[i]] = V[PV[(i + q) % mod]];
    }
    vector<bool> visp(n);
    for (int i = 0; i < n; i++) {
      if (VS[i] == 0) {
        visp[i] = true;
        VS[i] = V[i];
      }
    }
    int my = 0;
    for (int i = 1; i <= n + 1; i++) {
      if (!vis[i]) my = i;
    }
    cs = n - y - minp;
    for (int i = 0; i < n; i++) {
      if (visp[i]) continue;
      if (minp && VS[i] == V[i]) {
        VS[i] = my;
        minp--;
        visp[i] = true;
      }
    }
    for (int i = 0; i < n; i++) {
      if (visp[i]) continue;
      if (cs && VS[i] != V[i]) {
        VS[i] = my;
        cs--;
      }
    }
    printf("YES\n");
    for (int i = 0; i < n; i++) printf("%d ", VS[i]);
    printf("\n");
  }
}
