#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 1, x = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f * x;
}
const int N = 1e5;
const int SIZE = 4 * (N + 1);
int tt;
int n, x, y;
int a[N + 1], buc[N + 2];
vector<int> at[N + 2];
int color[N + 1], force[N + 1];
int pos[N + 1], tot;
set<pair<int, int>, greater<pair<int, int> > > s;
int main() {
  tt = read();
  while (tt--) {
    n = read();
    x = read();
    y = read() - x;
    memset(color, 0, SIZE);
    memset(force, 0, SIZE);
    memset(buc, 0, SIZE + 4);
    for (int i = 1; i <= n + 1; i++) at[i].clear();
    s.clear();
    for (int i = 1; i <= n; i++) {
      a[i] = read();
      buc[a[i]]++;
      at[a[i]].push_back(i);
    }
    for (int i = 1; i <= n + 1; i++)
      if (buc[i]) s.insert(make_pair(at[i].size(), i));
    for (int i = 1; i <= x; i++) {
      pair<int, int> a = *s.begin();
      s.erase(a);
      color[at[a.second][at[a.second].size() - 1]] = a.second;
      force[at[a.second][at[a.second].size() - 1]] = 1;
      at[a.second].pop_back();
      a.first--;
      if (a.first) s.insert(a);
    }
    tot = 0;
    for (int i = 1; i <= n + 1; i++)
      for (int j = 0; j < at[i].size(); j++) pos[++tot] = at[i][j];
    int c, cnt = 0;
    for (int i = 1; i <= n + 1; i++) {
      if (!buc[i]) {
        c = i;
        break;
      }
    }
    for (int i = 1; i <= tot; i++) {
      if (a[pos[i]] != a[pos[(i + tot / 2 - 1) % tot + 1]]) {
        color[pos[i]] = a[pos[(i + tot / 2 - 1) % tot + 1]];
        cnt++;
      } else {
        color[pos[i]] = c;
      }
    }
    if (cnt < y) {
      printf("NO\n");
      continue;
    }
    y = cnt - y;
    for (int i = 1; i <= n && y; i++) {
      if (!force[i] && color[i] != c) {
        color[i] = c;
        y--;
      }
    }
    printf("YES\n");
    for (int i = 1; i <= n; i++) printf("%d ", color[i]);
    printf("\n");
  }
  return 0;
}
