#include <bits/stdc++.h>
using namespace std;
using Ip = pair<int, int>;
using Pqip = priority_queue<Ip>;
using Vi = vector<int>;
using V2i = vector<Vi>;
int q, n, x, y;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  cin >> q;
  for (int i = 1; i <= q; ++i) {
    cin >> n >> x >> y;
    Pqip PQ;
    V2i Indices(n + 1);
    Vi Ans(n, -1), Arr(n);
    for (int i = 0, color; i < n; ++i)
      cin >> color, Arr[i] = color, --color, Indices[color].emplace_back(i);
    if (x == n) {
      cout << "YES\n";
      for (const auto& it : Arr) cout << it << " ";
      cout << "\n";
      continue;
    }
    int null = 0;
    for (int i = 0; i <= n; ++i)
      if (!Indices[i].empty())
        PQ.push(make_pair((int)Indices[i].size(), i));
      else
        null = i;
    int operations = 0;
    for (int i = 0; i < x; ++i) {
      int curr = PQ.top().second, link = Indices[curr].back();
      PQ.pop(), Indices[curr].pop_back();
      Ans[link] = curr, ++operations;
      if (!Indices[curr].empty())
        PQ.push(make_pair((int)Indices[curr].size(), curr));
    }
    int jmek = PQ.top().second, prev = jmek;
    PQ.pop();
    while (!PQ.empty()) {
      int curr = PQ.top().second, link = Indices[prev].back();
      PQ.pop(), Indices[prev].pop_back();
      Ans[link] = (operations < y ? curr : null), ++operations;
      if (!Indices[prev].empty())
        PQ.push(make_pair((int)Indices[prev].size() + (jmek == prev), prev));
      prev = curr;
    }
    if (prev != jmek) {
      int link = Indices[prev].back();
      Indices[prev].pop_back();
      Ans[link] = (operations < y ? jmek : null), ++operations;
    }
    if (operations >= y) {
      for (const auto& link : Indices[prev]) Ans[link] = null;
      cout << "YES\n";
      for (const auto& it : Ans) cout << it + 1 << " ";
      cout << "\n";
    } else
      cout << "NO\n";
  }
  return 0;
}
