#include <bits/stdc++.h>
using namespace std;
void Fast_IO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
}
int main() {
  Fast_IO();
  int n_testcases;
  cin >> n_testcases;
  for (int n_testcase = 1; n_testcase <= n_testcases; n_testcase++) {
    long long n, x, y;
    cin >> n >> x >> y;
    long long a[n];
    for (long long i = (long long)0; i <= (long long)n - 1; i++) cin >> a[i];
    long long F[n + 2];
    for (long long i = (long long)0; i <= (long long)n + 1; i++) F[i] = 0;
    for (long long i = (long long)0; i <= (long long)n - 1; i++) F[a[i]]++;
    vector<vector<long long> > adj(n + 2);
    for (long long i = (long long)0; i <= (long long)n - 1; i++)
      adj[a[i]].push_back(i);
    priority_queue<pair<long long, long long> > pq;
    for (long long i = (long long)1; i <= (long long)n + 1; i++)
      pq.push(make_pair(F[i], i));
    long long final[n];
    long long rem;
    for (long long i = (long long)1; i <= (long long)n + 1; i++)
      if (F[i] == 0) {
        rem = i;
        break;
      }
    while (x > 0) {
      x--;
      pair<long long, long long> u = pq.top();
      pq.pop();
      long long id = u.second;
      F[id]--;
      u.first--;
      if (u.first >= 1) pq.push(u);
      long long pos = adj[id][(long long)int(adj[id].size()) - 1];
      adj[id].pop_back();
      final[pos] = a[pos];
    }
    vector<pair<long long, long long> > lol;
    for (long long i = (long long)1; i <= (long long)n + 1; i++)
      if ((long long)int(adj[i].size()) > 0)
        lol.push_back(make_pair((long long)int(adj[i].size()), i));
    sort(lol.begin(), lol.end());
    vector<pair<long long, long long> > lmao;
    for (auto x : lol) {
      long long val = x.second;
      for (long long i = (long long)0;
           i <= (long long)(long long)int(adj[val].size()) - 1; i++)
        lmao.push_back(make_pair(val, adj[val][i]));
    }
    long long wtf = -1;
    for (long long i = (long long)(long long)int(lmao.size()) - 2;
         i >= (long long)0; i--)
      if (lmao[i].first != lmao[i + 1].first) {
        wtf = i;
        break;
      }
    long long remassigns = n - y;
    if (wtf == -1) {
      if ((long long)int(lmao.size()) <= remassigns) {
        for (auto x : lmao) final[x.second] = rem;
        cout << "YES" << '\n';
        for (long long i = (long long)0; i <= (long long)n - 1; i++)
          cout << final[i] << " ";
        cout << '\n';
      } else
        cout << "NO" << '\n';
    } else {
      vector<pair<long long, long long> > lmao2;
      for (auto x : lmao) lmao2.push_back(x);
      for (long long i = (long long)0;
           i <= (long long)(long long)int(lmao.size()) - 1; i++) {
        long long from = (long long)int(lmao.size()) - 1 - i;
        long long to = (wtf - i + (long long)int(lmao.size())) %
                       (long long)int(lmao.size());
        lmao2[to] = lmao[from];
      }
      wtf = 0;
      for (long long i = (long long)0;
           i <= (long long)(long long)int(lmao.size()) - 1; i++)
        if (lmao[i].first == lmao2[i].first) {
          wtf = i;
          break;
        }
      long long anomalies = 0;
      for (long long i = (long long)0;
           i <= (long long)(long long)int(lmao.size()) - 1; i++)
        if (lmao[i].first == lmao2[i].first) anomalies++;
      if (anomalies > remassigns)
        cout << "NO" << '\n';
      else {
        for (long long i = (long long)0;
             i <= (long long)(long long)int(lmao.size()) - 1; i++) {
          if (i <= remassigns - 1) {
            final[lmao2[(i + wtf) % (long long)int(lmao.size())].second] = rem;
          } else {
            final[lmao2[(i + wtf) % (long long)int(lmao.size())].second] =
                lmao[(i + wtf) % (long long)int(lmao.size())].first;
          }
        }
        cout << "YES" << '\n';
        for (long long i = (long long)0; i <= (long long)n - 1; i++)
          cout << final[i] << " ";
        cout << '\n';
      }
    }
  }
  return 0;
}
