#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxm = 1e5 + 10;
const int inf = 0x3f3f3f3f;
template <typename T>
inline bool read(T &x) {
  x = 0;
  bool neg = 0;
  char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-')
      neg = 1;
    else if (c == EOF)
      return 0;
  for (; '0' <= c && c <= '9'; c = getchar()) x = x * 10 + (c ^ 48);
  neg ? (x = -x) : 0;
  return c != EOF;
}
template <typename A, typename... B>
inline bool read(A &x, B &...y) {
  return read(x) && read(y...);
}
queue<int> pos[maxm];
vector<int> v;
int b[maxm], flag[maxm], num[maxm], app[maxm], ans[maxm], rk[maxm];
struct node {
  int col, num;
  friend bool operator<(node a, node b) { return a.num < b.num; }
};
priority_queue<node> pq;
void init(int n) {
  while (!pq.empty()) pq.pop();
  for (int i = 0; i <= n + 3; i++) {
    while (!pos[i].empty()) pos[i].pop();
    flag[i] = 0;
    num[i] = 0;
    app[i] = 0;
  }
  v.clear();
}
bool cmp(int a, int b) { return num[a] > num[b]; }
int main() {
  int T;
  read(T);
  while (T--) {
    int n, x, y;
    read(n, x, y);
    init(n);
    for (int i = 1; i <= n; i++) {
      read(b[i]);
      pos[b[i]].push(i);
      app[b[i]] = 1;
      num[b[i]]++;
    }
    for (int i = 1; i <= n + 1; i++)
      if (num[i]) pq.push({i, num[i]});
    for (int i = 1; i <= x; i++) {
      node nd = pq.top();
      while (nd.num != num[nd.col]) {
        pq.pop();
        nd = pq.top();
      }
      int j = pos[nd.col].front();
      pos[nd.col].pop();
      ans[j] = nd.col;
      flag[j] = 1;
      nd.num--;
      num[nd.col]--;
      pq.pop();
      if (nd.num) pq.push(nd);
    }
    for (int i = 1; i <= n + 1; i++) rk[i] = i;
    sort(rk + 1, rk + n + 2, cmp);
    rk[n + 2] = rk[1];
    int cnt = 0;
    int pt = 1;
    for (int i = 1; i <= n + 1; i++) {
      if (cnt >= y - x) break;
      int col1 = rk[i];
      if (num[col1] == 0) continue;
      for (int j = max(pt, i) + 1; j <= n + 2; j++) {
        int col2 = rk[j];
        if (col1 == col2) continue;
        if (pos[col2].empty()) {
          pt = j;
          continue;
        }
        while (!pos[col2].empty()) {
          int k = pos[col2].front();
          pos[col2].pop();
          ans[k] = col1;
          flag[k] = 1;
          num[col1]--;
          cnt++;
          if (num[col1] == 0 || cnt >= y - x) break;
        }
        if (pos[col2].empty()) pt = j;
        if (num[col1] == 0 || cnt >= y - x) break;
      }
    }
    if (cnt < y - x) {
      printf("NO\n");
      continue;
    }
    int noapp = 0;
    for (int i = 1; i <= n + 1; i++) {
      if (!app[i]) {
        noapp = i;
        break;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (!flag[i]) {
        ans[i] = noapp;
      }
    }
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      printf("%d%c", ans[i], i == n ? '\n' : ' ');
    }
  }
  return 0;
}
