#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T a) {
  for (auto x : a) cout << x << ' ';
  cout << '\n';
}
void solve() {
  int n, x, y;
  cin >> n >> x >> y;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  if (y < x) {
    cout << "NO" << '\n';
    return;
  }
  vector<vector<int> > cnt(n + 1);
  for (int i = 0; i < n; i++) {
    a[i]--;
    cnt[a[i]].push_back(i);
  }
  int free_color = -1;
  for (int i = 0; i < n + 1; i++)
    if (!(int)(cnt[i]).size()) free_color = i;
  set<pair<int, int> > s;
  for (int i = 0; i < n + 1; i++) {
    s.insert({(int)(cnt[i]).size(), i});
  }
  if (x > n) {
    cout << "NO" << '\n';
    return;
  }
  vector<int> to_fill(n + 1, 0);
  for (int i = 0; i < x; i++) {
    pair<int, int> cur = *s.rbegin();
    s.erase(cur);
    s.insert({cur.first - 1, cur.second});
    to_fill[cur.second]++;
  }
  y -= x;
  x = 0;
  vector<vector<int> > cmp(n + 1);
  vector<int> ans(n), to_do;
  for (int i = 0; i < n; i++) {
    if (to_fill[a[i]]) {
      ans[i] = a[i];
      to_fill[a[i]]--;
    } else {
      cmp[a[i]].push_back(i);
      ans[i] = -1;
    }
  }
  for (int i = 0; i < n + 1; i++)
    for (int x : cmp[i]) to_do.push_back(x);
  vector<int> v1, v2;
  for (int i = 0; i < (int)(to_do).size() / 2; i++) v1.push_back(to_do[i]);
  for (int i = (int)(to_do).size() / 2; i < (int)(to_do).size(); i++) {
    v2.push_back(to_do[i]);
  }
  vector<int> to_do1;
  for (int x : v2) to_do1.push_back(x);
  for (int x : v1) to_do1.push_back(x);
  int cur = (int)(to_do1).size();
  for (int i = 0; i < (int)(to_do1).size(); i++) {
    ans[to_do[i]] = a[to_do1[i]];
    if (a[to_do[i]] == a[to_do1[i]]) {
      ans[to_do[i]] = free_color;
      cur--;
    }
  }
  if (cur < y) {
    cout << "NO" << '\n';
    return;
  }
  for (int i = 0; i < (int)(to_do1).size() && cur > y; i++) {
    if (ans[to_do1[i]] == free_color) continue;
    ans[to_do1[i]] = free_color;
    cur--;
  }
  cout << "YES" << '\n';
  for (int x : ans) cout << ++x << ' ';
  cout << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
