#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long N = 1e5 + 14;
const long long inf = (long long)1e18 + 10;
const long long mod = 1e9 + 7;
const double eps = 1e-6;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
using namespace std;
long long q;
long long n, first, second;
long long a[N];
long long ans[N];
bool ex[N];
vector<long long> inds[N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  cin >> q;
  while (q--) {
    cin >> n >> first >> second;
    for (long long i = 0; i < n; ++i) cin >> a[i];
    fill(ex, ex + n + 2, false);
    for (long long i = 0; i < n; ++i) ex[a[i]] = true;
    long long ne = -1;
    for (long long i = 1; i <= n + 1; ++i)
      if (!ex[i]) {
        ne = i;
        break;
      }
    if (second < first) {
      cout << "NO"
           << "\n";
      continue;
    }
    for (long long i = 1; i <= n + 1; ++i) inds[i].clear();
    for (long long i = 0; i < n; ++i) inds[a[i]].push_back(i);
    set<pair<long long, long long>, greater<pair<long long, long long>>> st;
    for (long long i = 1; i <= n + 1; ++i)
      if (!inds[i].empty()) st.emplace(inds[i].size(), i);
    fill(ans, ans + n, -1);
    long long curx = 0;
    set<long long> need;
    while (curx < first) {
      long long f = st.begin()->second;
      long long i = inds[f].back();
      ans[i] = a[i];
      need.insert(i);
      st.erase(st.begin());
      inds[f].pop_back();
      if (inds[f].size()) st.emplace(inds[f].size(), f);
      ++curx;
    }
    vector<long long> v;
    for (auto p : st)
      for (auto i : inds[p.second]) v.push_back(i);
    for (long long i = 0; i < v.size(); ++i) {
      long long j = i - ((long long)v.size() / 2);
      if (j < 0) j += (long long)v.size();
      ans[v[i]] = a[v[j]];
    }
    long long cnt = 0;
    for (long long i = 0; i < n && cnt < (n - second); ++i)
      if (ans[i] == -1) {
        ans[i] = ne;
        ++cnt;
      }
    for (long long i = 0; i < n && cnt < (n - second); ++i)
      if (ans[i] == a[i] && need.find(i) == need.end() && ans[i] != ne) {
        ans[i] = ne;
        ++cnt;
      }
    for (long long i = 0; i < n && cnt < (n - second); ++i)
      if (ans[i] != a[i] && need.find(i) == need.end() && ans[i] != ne) {
        ans[i] = ne;
        ++cnt;
      }
    long long xval = 0;
    for (long long i = 0; i < n; ++i)
      if (ans[i] == a[i]) ++xval;
    bool ok = true;
    for (long long i = 0; i < n; ++i)
      if (ans[i] == -1) {
        ok = false;
        break;
      }
    if (xval != first || cnt < (n - second) || !ok) {
      cout << "NO"
           << "\n";
      continue;
    }
    cout << "YES"
         << "\n";
    for (long long i = 0; i < n; ++i) cout << ans[i] << " ";
    cout << "\n";
  }
}
