#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream& operator<<(ostream& out, const pair<T1, T2> p) {
  out << '(' << p.first << ',' << p.second << ')';
  return out;
}
template <class T1, class T2>
istream& operator>>(istream& in, pair<T1, T2>& p) {
  in >> p.first >> p.second;
  return in;
}
template <class T>
istream& operator>>(istream& in, vector<T>& v) {
  for (T& x : v) in >> x;
  return in;
}
template <class T>
ostream& operator<<(ostream& out, const vector<vector<T>>& v) {
  for (const vector<T>& x : v) out << x << '\n';
  return out;
}
template <class T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  for (const T& x : v) out << x << ' ';
  return out;
}
long long gcd(long long a, long long b) {
  if (b > a) swap(a, b);
  return (b ? gcd(b, a % b) : a);
}
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
using tiii = pair<pair<int, int>, int>;
using vi = vector<int>;
using vl = vector<long long>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
const int h = 1000000007;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.setstate(ios::failbit);
  int t;
  cin >> t;
  while (t--) {
    int n, x, y;
    cin >> n >> x >> y;
    vi v(n);
    cin >> v;
    set<int> s;
    for (int i = 1; i <= n + 1; i++) s.insert(i);
    for (int x : v) s.erase(x);
    int unseen = *s.begin();
    map<int, vi> m;
    vi ans(n);
    for (int i = (0); i < (n); i++) m[v[i]].push_back(i);
    priority_queue<pii> pq;
    for (auto x : m) pq.push(make_pair(x.second.size(), x.first));
    if (y < x) {
      cout << "NO\n";
      continue;
    }
    for (int i = (0); i < (x); i++) {
      auto p = pq.top();
      pq.pop();
      ans[m[p.second].back()] = p.second;
      m[p.second].pop_back();
      pq.push(make_pair(m[p.second].size(), p.second));
    }
    vector<pii> vp;
    for (auto x : m)
      for (int y : x.second) vp.push_back(make_pair(y, x.first));
    for (int i = (0); i < (n - y); i++) {
      auto p = pq.top();
      pq.pop();
      ans[m[p.second].back()] = unseen;
      m[p.second].pop_back();
      pq.push(make_pair(m[p.second].size(), p.second));
    }
    int mxc = 0;
    if (!pq.empty()) mxc = m[pq.top().second].size();
    bool Y = 1;
    for (int i = 0; i < vp.size(); i++) {
      int x = (i - mxc + vp.size()) % vp.size();
      if (ans[vp[i].first] != 0) continue;
      if (vp[x].second == vp[i].second) Y = 0;
      ans[vp[i].first] = vp[x].second;
    }
    cout << (Y ? "YES" : "NO") << '\n';
    if (Y) {
      cout << ans << '\n';
    }
  }
}
