#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n, x, y;
    cin >> n >> x >> y;
    long long tab[n];
    long long dl[n + 1];
    for (long long i = 0; i <= n; i++) dl[i] = 0;
    for (long long i = 0; i < n; i++) {
      long long g;
      cin >> g;
      g--;
      tab[i] = g;
      dl[g]++;
    }
    vector<pair<long long, long long>> len;
    long long las = -1;
    for (long long i = 0; i <= n; i++) {
      if (dl[i] == 0)
        las = i;
      else
        len.emplace_back(dl[i], i);
    }
    sort(len.begin(), len.end());
    long long rest = y - x, maxR = rest / 2 + (rest % 2 == 1), sumR = 0;
    for (long long i = 0; i < len.size() - 1; i++) {
      sumR += len[i].first;
    }
    if (sumR < maxR) {
      cout << "NO" << endl;
      continue;
    }
    maxR = rest / 2;
    vector<queue<long long>> block(n + 1);
    vector<pair<long long, long long>> len2;
    long long counter = 0;
    if (rest % 2 == 1 && len.size() == 2 && rest != 1) {
      if (2 * len[0].first - 1 < rest || y == n) {
        cout << "NO" << endl;
        continue;
      } else {
        rest--;
        block[len[0].second].push(len[1].second);
        block[len[1].second].push(las);
        while (rest > 0) {
          block[len[0].second].push(len[1].second);
          block[len[1].second].push(len[0].second);
          rest -= 2;
        }
      }
    } else if (rest == 1) {
      if (y == n) {
        cout << "NO" << endl;
        continue;
      }
      block[len[0].second].push(len[1].second);
      block[len[1].second].push(las);
    } else {
      while (rest > 0) {
        long long a = len[counter].first;
        if (a > maxR) a = maxR;
        if (a > rest) a = rest;
        rest -= a;
        len2.emplace_back(a, len[counter].second);
        counter++;
      }
      sort(len2.begin(), len2.end());
      for (long long i = (long long)len2.size() - 1; i >= 0; i--) {
        long long ile = len2[i].first, color = len2[i].second;
        counter = i - 1 >= 0 ? i - 1 : (long long)len2.size() - 1;
        while (ile > 0) {
          long long hehe =
              len2[counter].first - block[len2[counter].second].size();
          if (ile > hehe) {
            for (long long j = 0; j < hehe; j++) {
              block[len2[counter].second].push(color);
              ile--;
            }
          } else {
            for (long long j = 0; j < ile; j++) {
              block[len2[counter].second].push(color);
            }
            ile = 0;
          }
          counter = counter - 1 >= 0 ? counter - 1 : (long long)len2.size() - 1;
        }
      }
    }
    long long same = x;
    for (long long i = 0; i < n + 1; i++) {
      long long ile = (long long)dl[i] - block[i].size();
      for (long long j = 0; j < ile; j++) {
        if (same > 0) {
          block[i].push(i);
          same--;
        } else {
          block[i].push(las);
        }
      }
    }
    cout << "YES" << endl;
    for (long long i = 0; i < n; i++) {
      if (block[tab[i]].empty()) {
        cout << "hehexd"
             << " ";
      } else {
        cout << (block[tab[i]].front() + 1) << " ";
        block[tab[i]].pop();
      }
    }
    cout << endl;
  }
}
