#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
#pragma optimize("-O3")
inline long long read() {
  long long x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return x = f ? -x : x;
}
inline void write(long long x, bool f) {
  if (x == 0) {
    putchar('0');
    if (f) putchar('\n');
    return;
  }
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  static char s[23];
  int l = 0;
  while (x != 0) s[l++] = x % 10 + 48, x /= 10;
  while (l) putchar(s[--l]);
  if (f) putchar('\n');
}
int lowbit(int x) { return x & (-x); }
template <class T>
T big(const T &a1, const T &a2) {
  return a1 > a2 ? a1 : a2;
}
template <class T>
T sml(const T &a1, const T &a2) {
  return a1 < a2 ? a1 : a2;
}
template <typename T, typename... R>
T big(const T &f, const R &...r) {
  return big(f, big(r...));
}
template <typename T, typename... R>
T sml(const T &f, const R &...r) {
  return sml(f, sml(r...));
}
void debug_out() { cout << '\n'; }
template <typename T, typename... R>
void debug_out(const T &f, const R &...r) {
  cout << f << " ";
  debug_out(r...);
}
const char ptout[] = "%d";
template <typename T>
void print(const T &f) {
  printf(ptout, f);
  putchar('\n');
}
template <typename T, typename... R>
void print(const T &f, const R &...r) {
  printf(ptout, f);
  putchar(' ');
  print(r...);
}
const int HMOD[] = {1000000009, 1004535809};
const long long BASE[] = {1572872831, 1971536491};
const long long INFLL = 0x3f3f3f3f3f3f3f3fLL;
const int INF = 0x3f3f3f3f;
const int mod = 998244353;
const int MOD = 1e9 + 7;
const int MXN = 2e5 + 5;
const int MXE = 2e6 + 6;
int n, m, k;
int ar[MXN], is[MXN], num[MXN], br[MXN], bid[MXN];
vector<int> mp[MXN];
priority_queue<pair<int, int> > pq;
int main() {
  int tim = read();
  while (tim--) {
    n = read(), m = read(), k = read() - m;
    for (int i = 1; i <= n + 1; ++i) {
      is[i] = num[i] = bid[i] = 0;
      mp[i].clear();
    }
    int aim = 0, flag = 1;
    for (int i = 1; i <= n; ++i) {
      ar[i] = read();
      br[i] = ar[i];
      ++num[ar[i]];
      mp[ar[i]].emplace_back(i);
    }
    while (!pq.empty()) pq.pop();
    for (int i = 1; i <= n + 1; ++i) {
      if (num[i])
        pq.push(make_pair(num[i], i));
      else
        aim = i;
    }
    while (m > 0) {
      pair<int, int> u = pq.top();
      pq.pop();
      for (; m > 0 && (int)mp[u.second].size() > 0;) {
        is[mp[u.second].back()] = bid[mp[u.second].back()] = 1;
        mp[u.second].pop_back();
        --m;
        break;
      }
      if (mp[u.second].size())
        pq.push(make_pair(mp[u.second].size(), u.second));
    }
    while (m == 0 && k > 0) {
      if ((int)pq.size() == 0) {
        flag = 0;
        break;
      } else if ((int)pq.size() == 1) {
        int tmp = pq.top().second, pos;
        for (int i = 1; i <= n && k > 0; ++i) {
          if (is[i] && bid[i] == 0 && ar[i] != tmp && br[i] != tmp &&
              (int)mp[tmp].size() > 0) {
            pos = mp[tmp].back();
            is[pos] = 1;
            br[pos] = br[i];
            br[i] = tmp;
            mp[tmp].pop_back();
            --k;
          }
        }
        if (k > 0) flag = 0;
        break;
      }
      pair<int, int> u = pq.top();
      pq.pop();
      pair<int, int> v = pq.top();
      pq.pop();
      for (; k > 0 && (int)mp[v.second].size() > 0;) {
        if (k == 1) {
          int tmp = u.second, pos;
          for (int i = 1; i <= n && k > 0; ++i) {
            if (is[i] && bid[i] == 0 && ar[i] != tmp && br[i] != tmp &&
                (int)mp[tmp].size() > 0) {
              pos = mp[tmp].back();
              is[pos] = 1;
              br[pos] = br[i];
              br[i] = tmp;
              mp[tmp].pop_back();
              --k;
            }
          }
          if (k > 0) {
            swap(br[mp[u.second].back()], br[mp[v.second].back()]);
            br[mp[v.second].back()] = aim;
            is[mp[u.second].back()] = 1;
            mp[u.second].pop_back();
            mp[v.second].pop_back();
            --k;
          }
        } else {
          swap(br[mp[u.second].back()], br[mp[v.second].back()]);
          is[mp[u.second].back()] = is[mp[v.second].back()] = 1;
          mp[u.second].pop_back();
          mp[v.second].pop_back();
          k -= 2;
        }
      }
      if (mp[v.second].size())
        pq.push(make_pair(mp[v.second].size(), v.second));
      if (mp[u.second].size())
        pq.push(make_pair(mp[u.second].size(), u.second));
    }
    for (int i = 1; i <= n; ++i)
      if (is[i] == 0) br[i] = aim;
    if (flag == 0 || m > 0)
      printf("NO\n");
    else {
      printf("YES\n");
      for (int i = 1; i <= n; ++i) {
        printf("%d%c", br[i], " \n"[i == n]);
      }
    }
  }
  return 0;
}
