#include <bits/stdc++.h>
using namespace std;
const long long N = 1 << 20, M = 1 << 17, mod = 1e9 + 7, inf = 3e18;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long tc;
  cin >> tc;
  while (tc--) {
    long long n, x, y, a, id;
    cin >> n >> x >> y;
    y -= x;
    vector<long long> vec[n + 2];
    for (long long i = 1; i <= n; i++) cin >> a, vec[a].push_back(i);
    priority_queue<pair<long long, long long> > pq;
    for (long long i = 1; i <= n + 1; i++)
      if (vec[i].size())
        pq.push({vec[i].size(), i});
      else
        id = i;
    long long ans[n + 1];
    while (x--) {
      pair<long long, long long> p = pq.top();
      pq.pop();
      ans[vec[p.second].back()] = p.second;
      vec[p.second].pop_back();
      if (vec[p.second].size()) pq.push({vec[p.second].size(), p.second});
    }
    while (y > 1 && pq.size() > 1 && (pq.size() > 3 || pq.top().first > 1)) {
      pair<long long, long long> p1 = pq.top();
      pq.pop();
      pair<long long, long long> p2 = pq.top();
      pq.pop();
      ans[vec[p1.second].back()] = p2.second;
      vec[p1.second].pop_back();
      ans[vec[p2.second].back()] = p1.second;
      vec[p2.second].pop_back();
      if (vec[p1.second].size()) pq.push({vec[p1.second].size(), p1.second});
      if (vec[p2.second].size()) pq.push({vec[p2.second].size(), p2.second});
      y -= 2;
    }
    if (y == 3 && pq.size() > 2) {
      pair<long long, long long> p1 = pq.top();
      pq.pop();
      pair<long long, long long> p2 = pq.top();
      pq.pop();
      pair<long long, long long> p3 = pq.top();
      pq.pop();
      ans[vec[p1.second].back()] = p2.second;
      vec[p1.second].pop_back();
      ans[vec[p2.second].back()] = p3.second;
      vec[p2.second].pop_back();
      ans[vec[p3.second].back()] = p1.second;
      vec[p3.second].pop_back();
    } else if (y == 2 && pq.size() > 1) {
      pair<long long, long long> p1 = pq.top();
      pq.pop();
      pair<long long, long long> p2 = pq.top();
      pq.pop();
      ans[vec[p1.second].back()] = p2.second;
      vec[p1.second].pop_back();
      ans[vec[p2.second].back()] = p1.second;
      vec[p2.second].pop_back();
    } else if (y == 1 && pq.size() > 1) {
      pair<long long, long long> p1 = pq.top();
      pq.pop();
      pair<long long, long long> p2 = pq.top();
      pq.pop();
      ans[vec[p1.second].back()] = p2.second;
      vec[p1.second].pop_back();
    } else if (y) {
      cout << "NO\n";
      continue;
    }
    for (long long i = 1; i <= n + 1; i++)
      for (long long j : vec[i]) ans[j] = id;
    cout << "YES\n";
    for (long long i = 1; i <= n; i++) cout << ans[i] << ' ';
    cout << "\n";
  }
}
