#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const int N = 1e6 + 10;
const long long mod = 1e9 + 7;
const long long mod2 = 998244353;
const long long inf = 8e18;
const int LOG = 22;
long long pw(long long a, long long b, long long M) {
  return (!b ? 1
             : (b & 1 ? (a * pw(a * a % M, b / 2, M)) % M
                      : pw(a * a % M, b / 2, M)));
}
void solve() {
  int n, x, y, unused = 1, sum = 0;
  cin >> n >> x >> y;
  vector<pair<int, int> > v, E;
  vector<int> a(n + 1), ans(n + 1);
  vector<vector<int> > c(n + 2);
  set<pair<int, int> > st;
  y -= x;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    c[a[i]].push_back(i);
  }
  for (int i = 1; i <= n + 1; i++) {
    if (c[i].empty()) {
      unused = i;
      continue;
    }
    st.insert(make_pair((int)c[i].size(), i));
  }
  for (int i = 1; i <= n; i++) {
    ans[i] = unused;
  }
  while (x) {
    int cu = (--st.end())->second;
    st.erase(--st.end());
    ans[c[cu].back()] = cu;
    c[cu].pop_back();
    st.insert(make_pair((int)c[cu].size(), cu));
    x--;
  }
  for (auto it = st.begin(); it != st.end(); it++) {
    v.push_back(*it);
  }
  for (int i = 0; i < (int)v.size() - 1; i++) {
    sum += v[i].first;
  }
  while (v.back().first > sum) {
    c[v.back().second].pop_back();
    v.back().first--;
  }
  sum += v.back().first;
  if (sum < y) {
    cout << "NO"
         << "\n";
    return;
  }
  cout << "YES"
       << "\n";
  if (y) {
    for (auto cu : v) {
      for (auto pos : c[cu.second]) {
        E.push_back(make_pair(pos, cu.second));
      }
    }
    int right = v.back().first, M = (int)E.size();
    for (int i = 0; i < y; i++) {
      ans[E[i].first] = E[(i + right) % M].second;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int q;
  cin >> q;
  while (q--) {
    solve();
  }
  return 0;
}
