#include <bits/stdc++.h>
using namespace std;
const long long MX = 1e5 + 10;
long long A[MX];
long long cnt[MX];
vector<long long> pos[MX];
long long ans[MX];
void init(long long n) {
  for (long long i = 0; i <= n + 2; i++) cnt[i] = 0;
  for (long long i = 0; i <= n + 2; i++) pos[i].clear();
  for (long long i = 0; i <= n + 2; i++) ans[i] = -1;
}
void salida(long long n, long long val) {
  for (long long i = 0; i < n; i++)
    if (ans[i] == -1) ans[i] = val;
  cout << "YES\n";
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
  cout << "\n";
}
void solve() {
  long long n, fijo, tot, x;
  cin >> n >> fijo >> tot;
  long long nfijo = tot - fijo;
  init(n);
  set<long long> s;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    A[i] = x;
    cnt[x]++;
    pos[x].push_back(i);
    s.insert(x);
  }
  long long maxNum = n + 1;
  priority_queue<pair<long long, long long> > pq;
  for (long long i = 1; i <= maxNum; i++) {
    if (cnt[i] != 0) pq.push({cnt[i], i});
  }
  while (!pq.empty() && fijo != 0) {
    long long cn = pq.top().first;
    long long val = pq.top().second;
    pq.pop();
    cnt[val]--;
    if (cnt[val] != 0) pq.push({cnt[val], val});
    long long sz = pos[val].size();
    ans[pos[val][sz - 1]] = val;
    pos[val].erase(pos[val].begin() + sz - 1);
    fijo--;
  }
  if (fijo > 0) {
    cout << "NO\n";
    return;
  }
  long long numExtra = -1;
  for (long long i = 1; i <= maxNum; i++) {
    if (s.find(i) == s.end()) numExtra = i;
  }
  if (nfijo == 0) {
    salida(n, numExtra);
    return;
  }
  long long falta = 0;
  for (long long i = 1; i <= maxNum; i++) falta += cnt[i];
  long long mxSize = pq.top().first;
  vector<long long> posi;
  while (!pq.empty()) {
    long long val = pq.top().second;
    pq.pop();
    for (long long xx : pos[val]) posi.push_back(xx);
  }
  if (mxSize <= falta - mxSize) {
    long long sz = posi.size();
    long long mid = sz / 2;
    for (long long i = 0; i < sz; i++) {
      if (nfijo == 0) break;
      long long cur = i;
      long long nxt = (i + mid) % sz;
      ans[posi[cur]] = A[posi[nxt]];
      nfijo--;
    }
    salida(n, numExtra);
  } else {
    reverse(posi.begin(), posi.end());
    long long mxPos = falta - mxSize;
    if (mxPos * 2 < nfijo) {
      cout << "NO\n";
      return;
    }
    long long sz = posi.size();
    for (long long i = 0; i < sz; i++) {
      if (nfijo == 0) break;
      long long cur = i;
      long long nxt = i + mxPos;
      if (nfijo == 0) break;
      ans[posi[cur]] = A[posi[nxt]];
      nfijo--;
      if (nfijo == 0) break;
      ans[posi[nxt]] = A[posi[cur]];
      nfijo--;
    }
    salida(n, numExtra);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(10);
  cout << fixed;
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
