#include <bits/stdc++.h>
using namespace std;
const int N = 200050;
const int inf = 0x3f3f3f3f;
const long long llinf = 0x3f3f3f3f3f3f;
const long long mod = 998244353LL;
clock_t TIME_START, TIME_END;
void program_end() {}
int n, x, y;
int b[N];
int ans[N];
int cnt[N];
set<int> pos[N], vec;
priority_queue<pair<int, int> > q;
void solve() {
  cin >> n >> x >> y;
  memset(ans, 0, ((n) + 5) * sizeof(int));
  while (!q.empty()) q.pop();
  memset(cnt, 0, ((n) + 5) * sizeof(int));
  for (int i = 0; i <= n + 1; ++i) pos[i].clear();
  for (int i = 1; i <= n; ++i)
    scanf("%d", &b[i]), cnt[b[i]]++, pos[b[i]].insert(i);
  int notexist = 0;
  for (int i = 1; i <= n + 1; ++i) {
    if (cnt[i] == 0) {
      notexist = i;
      continue;
    }
    q.push(make_pair((cnt[i]), (i)));
  }
  int tot = 0;
  while (!q.empty() && tot < x) {
    pair<int, int> u = q.top();
    q.pop();
    u.first--;
    ans[*pos[u.second].begin()] = u.second;
    pos[u.second].erase(*pos[u.second].begin());
    cnt[u.second]--;
    if (u.first > 0) q.push(u);
    tot++;
  }
  if (tot < x) return puts("NO"), void();
  tot = 0;
  int cha = y - x;
  vec.clear();
  pair<int, int> mxx = q.top();
  while (!q.empty() && cha) {
    pair<int, int> mx = q.top();
    q.pop();
    int nowcnt = mx.first;
    int nownum = mx.second;
    while ((nowcnt) && !q.empty() && cha) {
      pair<int, int> u = q.top();
      q.pop();
      ans[*pos[nownum].begin()] = u.second;
      cnt[u.second]--;
      pos[nownum].erase(*pos[nownum].begin());
      nowcnt--;
      cha--;
      if (cnt[u.second] > 0) q.push(u);
      if (pos[nownum].empty()) break;
    }
    if (nowcnt == 0)
      vec.insert(mx.second);
    else {
      vector<int> ttt;
      for (auto i : vec) {
        while (cha && cnt[i] && !pos[nownum].empty()) {
          cnt[i]--;
          ans[*pos[nownum].begin()] = i;
          pos[nownum].erase(*pos[nownum].begin());
          cha--;
        }
        if (cnt[i] == 0) ttt.push_back(i);
        if (pos[nownum].empty()) {
          vec.insert(nownum);
          break;
        }
      }
      for (auto i : ttt) vec.erase(i);
      if (cha) break;
    }
  }
  if (cha) {
    if (!pos[mxx.second].empty()) {
      for (int i = 1; i <= n && cha && cnt[mxx.second]; ++i) {
        if (ans[i] == 0 && b[i] != mxx.second) {
          ans[i] = mxx.second;
          cnt[mxx.second]--;
          cha--;
        }
      }
    } else {
      auto it = vec.begin();
      for (int i = 1; i <= n && cha; ++i) {
        if (ans[i] == 0) {
          cha--;
          ans[i] = (*it);
          cnt[*it]--;
          if (cnt[*it] == 0) it++;
        }
      }
    }
  }
  if (cha) return puts("NO"), void();
  printf("YES\n");
  for (int i = 1; i <= n; ++i) printf("%d ", (ans[i] == 0) ? notexist : ans[i]);
  puts("");
}
int main() {
  TIME_START = clock();
  int Test = 1;
  cin >> Test;
  while (Test--) solve();
  TIME_END = clock();
  program_end();
  return 0;
}
