#include <bits/stdc++.h>
using namespace std;
const long long infl = 0x3f3f3f3f3f3f3f3fLL;
const long long infi = 0x3f3f3f3f;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
const long long mod = 1e9 + 7;
const long long N = 2e5 + 5;
void solve() {
  long long n, x, y, dne;
  cin >> n >> x >> y;
  vector<long long> a(n), b(n);
  vector<vector<long long>> g(n + 2);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    g[a[i]].push_back(i);
  }
  priority_queue<pair<long long, long long>> q;
  for (long long i = 1; i <= n + 1; i++) {
    if (((long long)g[i].size()))
      q.push({((long long)g[i].size()), i});
    else
      dne = i;
  }
  for (long long i = 1; i <= x; i++) {
    pair<long long, long long> p = q.top();
    q.pop();
    long long col = p.second;
    b[g[col].back()] = a[g[col].back()];
    g[col].pop_back();
    if (((long long)g[col].size())) q.push({((long long)g[col].size()), col});
  }
  long long z = y - x, mx = 0;
  if (z < 0) {
    cout << "NO" << '\n';
    return;
  }
  vector<pair<long long, long long>> v;
  for (long long i = 1; i <= n + 1; i++) {
    for (auto &pos : g[i]) v.push_back({i, pos});
    mx = max(mx, ((long long)g[i].size()));
  }
  for (long long i = 0; i < ((long long)v.size()); i++) {
    long long col = v[i].first;
    long long pos = (i + mx) % ((long long)v.size());
    if (z && v[pos].first ^ col) {
      b[v[pos].second] = col;
      z--;
    } else
      b[v[pos].second] = dne;
  }
  if (z) {
    cout << "NO" << '\n';
    return;
  }
  cout << "YES" << '\n';
  for (long long i = 0; i < n; i++) cout << b[i] << " ";
  cout << '\n';
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);
  long long t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
long long powm(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long divide(long long a, long long b) {
  return (a % mod) * powm(b, mod - 2) % mod;
}
long long norm(long long a) {
  while (a >= mod) a -= mod;
  while (a < 0) a += mod;
  return a;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
