#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
const int INF = 1e9 + 7;
int T;
int a[N], c[N], vis[N], b[N], v[N];
vector<int> d[N];
struct pir {
  int x, v;
  friend bool operator<(pir a, pir b) { return a.v > b.v; }
};
priority_queue<pir> Q;
struct pir2 {
  int x, v;
  friend bool operator<(pir2 a, pir2 b) { return a.v < b.v; }
};
priority_queue<pir2> Q2;
int main() {
  scanf("%d", &T);
  while (T--) {
    int n, x, y;
    scanf("%d%d%d", &n, &x, &y);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    if (x == n) {
      puts("YES");
      for (int i = 1; i <= n; i++) printf("%d ", a[i]);
      puts("");
      continue;
    }
    for (int i = 1; i <= n + 1; i++) c[i] = v[i] = b[i] = 0;
    while (!Q.empty()) Q.pop();
    while (!Q2.empty()) Q2.pop();
    for (int i = 1; i <= n; i++) c[a[i]]++;
    int hh = 0;
    for (int i = 1; i <= n + 1; i++)
      if (!c[i]) {
        hh = i;
        break;
      }
    if (x == y) {
      puts("YES");
      for (int i = 1; i <= x; i++) printf("%d ", a[i]);
      for (int i = 1; i <= n - x; i++) printf("%d ", hh);
      puts("");
      continue;
    }
    for (int i = 1; i <= n + 1; i++) d[i].clear();
    for (int i = 1; i <= n; i++) d[a[i]].push_back(i);
    for (int i = 1; i <= n + 1; i++)
      if (c[i]) Q.push((pir){i, 1});
    for (int i = 1; i <= n - x; i++) {
      pir q = Q.top();
      Q.pop();
      v[q.x] = q.v;
      if (c[q.x] != q.v) Q.push((pir){q.x, q.v + 1});
    }
    int nw = n - x, gg = 0;
    for (int i = 1; i <= n + 1; i++)
      if (v[i]) Q2.push((pir2){i, v[i]});
    for (int i = 1; i <= n - y; i++) {
      if (i == n - y && nw % 2 == 0) {
        gg = 1;
        break;
      }
      pir2 q = Q2.top();
      Q2.pop();
      b[d[q.x][q.v - 1]] = hh;
      if (q.v > 1) Q2.push((pir2){q.x, q.v - 1});
      nw--;
    }
    pir2 h = Q2.top();
    if (h.v + h.v > nw) {
      puts("NO");
      continue;
    }
    for (; nw > 3; nw -= 2) {
      pir2 h1 = Q2.top();
      Q2.pop();
      pir2 h2 = Q2.top();
      Q2.pop();
      b[d[h1.x][h1.v - 1]] = a[d[h2.x][h2.v - 1]];
      b[d[h2.x][h2.v - 1]] = a[d[h1.x][h1.v - 1]];
      if (h1.v != 1) Q2.push((pir2){h1.x, h1.v - 1});
      if (h2.v != 1) Q2.push((pir2){h2.x, h2.v - 1});
    }
    if (nw == 2) {
      pir2 h1 = Q2.top();
      Q2.pop();
      pir2 h2 = Q2.top();
      Q2.pop();
      b[d[h1.x][0]] = h2.x;
      b[d[h2.x][0]] = h1.x;
    } else {
      pir2 h1 = Q2.top();
      Q2.pop();
      pir2 h2 = Q2.top();
      Q2.pop();
      pir2 h3 = Q2.top();
      Q2.pop();
      b[d[h1.x][0]] = h2.x;
      b[d[h2.x][0]] = h3.x;
      b[d[h3.x][0]] = h1.x;
    }
    if (gg) {
      for (int i = 1; i <= n; i++)
        if (b[i] && b[i] != hh) {
          b[i] = hh;
          break;
        }
    }
    for (int i = 1; i <= n; i++)
      if (!b[i]) b[i] = a[i];
    puts("YES");
    for (int i = 1; i <= n; i++) printf("%d ", b[i]);
    puts("");
  }
  return 0;
}
