#include <bits/stdc++.h>
using namespace std;
char _buf[100000], *_op(_buf), *_ed(_buf);
inline int getint() {
  int _s = 0, _f = 1;
  char _ch = (_op == _ed && (_ed = (_op = _buf) + fread(_buf, 1, 100000, stdin),
                             _op == _ed)
                  ? EOF
                  : *_op++);
  while (!('0' <= _ch && _ch <= '9'))
    (_ch == '-') && (_f = -1),
        _ch =
            (_op == _ed && (_ed = (_op = _buf) + fread(_buf, 1, 100000, stdin),
                            _op == _ed)
                 ? EOF
                 : *_op++);
  while (('0' <= _ch && _ch <= '9'))
    _s = _s * 10 + _ch - 48,
    _ch = (_op == _ed && (_ed = (_op = _buf) + fread(_buf, 1, 100000, stdin),
                          _op == _ed)
               ? EOF
               : *_op++);
  return _s * _f;
}
const int N = 2e5 + 100, INF = 0x3f3f3f3f;
vector<int> pos[N];
int T, n, m, X, Y, S, now, tot, sta[N];
int a[N], c[N], out[N];
priority_queue<pair<int, int> > q;
inline void input() {
  n = getint(), X = getint(), Y = getint();
  for (int i = 1; i <= n + 1; i++) c[i] = 0;
  for (int i = 1; i <= n; i++)
    a[i] = getint(), c[a[i]]++, pos[a[i]].push_back(i);
}
inline void init() {
  for (int i = 1; i <= n + 1; i++) {
    if (!c[i]) S = i;
    q.push(pair<int, int>(c[i], i));
  }
  Y -= X, tot = 0;
  while (X--) {
    pair<int, int> x = q.top();
    q.pop();
    int p = x.second;
    out[pos[p].back()] = p;
    pos[p].pop_back();
    q.push(pair<int, int>(--c[p], p));
  }
  int maxn = q.top().first;
  for (int i = 1; i <= n + 1; i++) {
    while (!pos[i].empty()) sta[++tot] = pos[i].back(), pos[i].pop_back();
  }
  if (Y)
    for (int i = 1; i <= tot; i++) {
      int p = (i + maxn - 1) % tot + 1;
      if (a[sta[i]] ^ a[sta[p]]) {
        out[sta[i]] = a[sta[p]];
        if (!--Y) break;
      }
    }
  if (Y) return void(cout << "NO\n");
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << (!out[i] ? S : out[i]) << " \n"[i == n];
}
inline void work() {
  for (int i = 1; i <= n; i++) out[i] = 0;
  while (!q.empty()) q.pop();
  while (tot) sta[tot--] = 0;
}
int main() {
  for (scanf("%d", &T); T--;) {
    input();
    init();
    work();
  }
  return 0;
}
