#include <bits/stdc++.h>
using namespace std;
vector<long long> generateCycle(set<pair<long long, long long>> &s,
                                vector<vector<long long>> &pos, long long n,
                                long long sz) {
  vector<long long> cycle(sz, -1);
  long long c = 0;
  while (!s.empty()) {
    auto it = s.end();
    assert(it != s.begin());
    it--;
    long long cnt = it->first;
    long long num = it->second;
    s.erase(it);
    for (int k = 0; k < cnt; k++) {
      assert(c < cycle.size());
      cycle[c] = pos[num][k];
      c += 2;
      if (c >= sz) {
        c = 1;
      }
    }
  }
  return cycle;
}
void solve() {
  long long n, x, y;
  cin >> n >> x >> y;
  long long special = -1;
  vector<long long> b(n);
  vector<long long> cnt(n + 2, false);
  vector<vector<long long>> pos(n + 2);
  vector<long long> ans(n, -1);
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    cnt[b[i]]++;
    pos[b[i]].push_back(i);
  }
  long long sum = 0;
  set<pair<long long, long long>> s;
  for (int i = 1; i <= n + 1; i++) {
    if (cnt[i] == 0) {
      special = i;
    } else {
      s.insert({cnt[i], i});
    }
  }
  for (int i = 0; i < x; i++) {
    auto it = s.end();
    assert(it != s.begin());
    it--;
    long long val = it->first;
    long long num = it->second;
    ans[pos[num].back()] = num;
    pos[num].pop_back();
    s.erase(it);
    val--;
    if (val > 0) {
      s.insert({val, num});
    }
  }
  long long maxY = n - x;
  while (!s.empty()) {
    auto it = s.end();
    assert(it != s.begin());
    it--;
    long long val = it->first;
    long long num = it->second;
    if (val <= maxY / 2) {
      break;
    }
    pos[num].pop_back();
    s.erase(it);
    val--;
    maxY--;
    if (val > 0) {
      s.insert({val, num});
    }
  }
  if (x + maxY < y) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  vector<long long> cycle = generateCycle(s, pos, n, maxY);
  for (long long i = 0; i < y - x; i++) {
    long long nextPos = (i + 1) % (long long)cycle.size();
    assert(b[cycle[i]] != b[cycle[nextPos]]);
    ans[cycle[i]] = b[cycle[nextPos]];
  }
  for (int i = 0; i < ans.size(); i++) {
    if (ans[i] == -1) ans[i] = special;
    cout << ans[i] << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T;
  cin >> T;
  for (long long t = 0; t < (long long)T; t++) solve();
  return 0;
}
