#include <bits/stdc++.h>
using namespace std;
int main() {
  int te;
  cin >> te;
  for (int w = 0; w < te; w++) {
    int n, x, y;
    cin >> n >> x >> y;
    vector<int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    if (y > n)
      cout << "NO" << endl;
    else {
      vector<int> ans(n, 0);
      vector<bool> vis(n + 2, false), vis1(n, false);
      map<int, set<int> > m;
      map<int, set<int> >::iterator itm;
      for (int i = 0; i < n; i++) {
        m[v[i]].insert(i);
        vis[v[i]] = true;
      }
      int nvs;
      for (int i = 1; i < n + 2; i++) {
        if (vis[i] == false) {
          nvs = i;
          break;
        }
      }
      set<pair<int, int> > s;
      set<pair<int, int> >::iterator its;
      for (itm = m.begin(); itm != m.end(); itm++) {
        int a = itm->first, b = itm->second.size();
        s.insert({-b, a});
      }
      int t = x;
      int e = y - x;
      while (t > 0) {
        its = s.begin();
        pair<int, int> p = *its;
        s.erase(its);
        int num = p.second;
        int x = *m[num].begin();
        ans[x] = num;
        vis1[x] = true;
        m[num].erase(m[num].begin());
        p.first += 1;
        if (p.first != 0) s.insert(p);
        t -= 1;
      }
      vector<vector<int> > v1(n + 2);
      vector<pair<int, int> > temp;
      for (its = s.begin(); its != s.end(); its++) temp.push_back(*its);
      int e1 = e;
      while (e > 0) {
        for (int i = 0; i < temp.size() and e > 0; i++) {
          int num = temp[i].second;
          int x = *m[num].begin();
          v1[num].push_back(x);
          vis1[x] = true;
          m[num].erase(m[num].begin());
          temp[i].first += 1;
          e -= 1;
        }
        for (int i = temp.size() - 1; i > -1; i--) {
          if (temp[i].first == 0) temp.erase(temp.end() - 1);
        }
      }
      e = e1;
      int pos = 1, len = 0, ii;
      for (int i = 0; i < v1.size(); i++) {
        len += v1[i].size();
        if (v1[i].size() > e / 2) {
          ii = i;
          pos = 0;
        }
      }
      if (pos == 0 and len % 2 == 1) {
        int f = 0;
        for (itm = m.begin(); itm != m.end(); itm++) {
          if (itm->first != ii and itm->second.size() > 0) {
            f = 1;
            int ind = *itm->second.begin();
            vis1[ind] = true;
            ans[ind] = ii;
            int last = v1[ii][v1[ii].size() - 1];
            ans[last] = nvs;
            v1[ii].erase(v1[ii].end() - 1);
            vis1[last] = true;
            e -= 1;
            break;
          }
        }
        if (f == 1) pos = 1;
      }
      if (pos == 0)
        cout << "NO" << endl;
      else {
        vector<int> temp;
        vector<pair<int, int> > temp1;
        for (int i = 1; i < v1.size(); i++) temp1.push_back({-v1[i].size(), i});
        sort(temp1.begin(), temp1.end());
        for (int i = 0; i < temp1.size(); i++) {
          int ind = temp1[i].second;
          for (int j = 0; j < v1[ind].size(); j++) temp.push_back(v1[ind][j]);
        }
        vector<int> imp(e);
        int ind = 0;
        for (int i = 0; i < e; i += 2) {
          imp[i] = temp[ind];
          ind += 1;
        }
        for (int i = 1; i < e; i += 2) {
          imp[i] = temp[ind];
          ind += 1;
        }
        for (int i = 0; i < e - 1; i++) ans[imp[i]] = v[imp[i + 1]];
        if (e > 0) ans[imp[e - 1]] = v[imp[0]];
        for (int i = 0; i < n; i++) {
          if (vis1[i] == false) ans[i] = nvs;
        }
        cout << "YES" << endl;
        for (int i = 0; i < n; i++) cout << ans[i] << " ";
        cout << endl;
      }
    }
  }
}
