#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
queue<int> p[maxn];
struct Number {
  int v, cnt;
  bool operator<(const Number& a) const { return cnt > a.cnt; }
} a[maxn];
int need[maxn], ans[maxn], vis[maxn], b[maxn], fa[maxn];
priority_queue<pair<int, int> > Q;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, x, y;
    scanf("%d%d%d", &n, &x, &y);
    for (int i = 1; i <= n + 1; i++) {
      while (!p[i].empty()) p[i].pop();
      a[i] = {i, 0};
      need[i] = 0;
      ans[i] = 0;
      vis[i] = 0;
      fa[i] = i;
    }
    while (!Q.empty()) Q.pop();
    for (int i = 1; i <= n; i++) {
      scanf("%d", &b[i]);
      a[b[i]].cnt++;
      Q.push({a[b[i]].cnt, b[i]});
      p[b[i]].push(i);
      vis[b[i]] = 1;
    }
    for (int i = 1; i <= x; i++) {
      int v = Q.top().second;
      Q.pop();
      int pos = p[v].front();
      p[v].pop();
      ans[pos] = v;
      a[v].cnt--;
    }
    sort(a + 1, a + 1 + n + 1);
    int pos = 1;
    int res = y - x;
    while (pos <= n && a[pos].cnt && res) {
      int can = min(res, min(n - x - a[pos].cnt, a[pos].cnt));
      need[a[pos].v] = can;
      res -= can;
      pos++;
    }
    if (res) {
      printf("NO\n");
      continue;
    }
    bool ok = false;
    pos = 1;
    for (int i = 1; i <= n && a[i].cnt; i++) {
      if (need[a[i].v] == 0) continue;
      while (need[a[i].v]) {
        if (pos == i || !p[a[pos].v].size()) pos++;
        if (a[pos].cnt == 0) pos = 1;
        if (pos == i) {
          ok = true;
          break;
        }
        while (need[a[i].v] && p[a[pos].v].size()) {
          ans[p[a[pos].v].front()] = a[i].v;
          need[a[i].v]--;
          p[a[pos].v].pop();
        }
      }
      if ((need[a[i].v] != 0) || ok) {
        ok = true;
        break;
      }
    }
    if (ok) {
      printf("NO\n");
      continue;
    }
    int no = 1;
    while (vis[no]) no++;
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      if (i != 1) printf(" ");
      printf("%d", ans[i] ? ans[i] : no);
    }
    printf("\n");
  }
  return 0;
}
