In the game of Mastermind, there are two players — Alice and Bob. Alice has a secret code, which Bob tries to guess. Here, a code is defined as a sequence of n colors. There are exactly n+1 colors in the entire universe, numbered from 1 to n+1 inclusive.

When Bob guesses a code, Alice tells him some information about how good of a guess it is, in the form of two integers x and y.

The first integer x is the number of indices where Bob's guess correctly matches Alice's code. The second integer y is the size of the intersection of the two codes as multisets. That is, if Bob were to change the order of the colors in his guess, y is the maximum number of indices he could get correct.

For example, suppose n=5, Alice's code is [3,1,6,1,2], and Bob's guess is [3,1,1,2,5]. At indices 1 and 2 colors are equal, while in the other indices they are not equal. So x=2. And the two codes have the four colors 1,1,2,3 in common, so y=4.

<image> Solid lines denote a matched color for the same index. Dashed lines denote a matched color at a different index. x is the number of solid lines, and y is the total number of lines. 

You are given Bob's guess and two values x and y. Can you find one possibility of Alice's code so that the values of x and y are correct?

Input

The first line contains a single integer t (1≤ t≤ 1000) — the number of test cases. Next 2t lines contain descriptions of test cases.

The first line of each test case contains three integers n,x,y (1≤ n≤ 10^5, 0≤ x≤ y≤ n) — the length of the codes, and two values Alice responds with.

The second line of each test case contains n integers b_1,…,b_n (1≤ b_i≤ n+1) — Bob's guess, where b_i is the i-th color of the guess.

It is guaranteed that the sum of n across all test cases does not exceed 10^5.

Output

For each test case, on the first line, output "YES" if there is a solution, or "NO" if there is no possible secret code consistent with the described situation. You can print each character in any case (upper or lower).

If the answer is "YES", on the next line output n integers a_1,…,a_n (1≤ a_i≤ n+1) — Alice's secret code, where a_i is the i-th color of the code.

If there are multiple solutions, output any.

Example

Input


7
5 2 4
3 1 1 2 5
5 3 4
1 1 2 1 2
4 0 4
5 5 3 3
4 1 4
2 3 2 3
6 1 2
3 2 1 1 1 1
6 2 4
3 3 2 1 1 1
6 2 6
1 1 3 2 1 1


Output


YES
3 1 6 1 2
YES
3 1 1 1 2
YES
3 3 5 5
NO
YES
4 4 4 4 3 1
YES
3 1 3 1 7 7
YES
2 3 1 1 1 1

Note

The first test case is described in the statement.

In the second test case, x=3 because the colors are equal at indices 2,4,5. And y=4 because they share the colors 1,1,1,2.

In the third test case, x=0 because there is no index where the colors are the same. But y=4 because they share the colors 3,3,5,5.

In the fourth test case, it can be proved that no solution exists.

Source: codeforces | Difficulty: VERY_HARD
Tags: Constructive algorithms

Sorting

Amortized analysis

Implementation

Greedy algorithms

Flows and cuts


Solutions:
from sys import stdin, stdout
from collections import defaultdict
from heapq import heapify, heappop, heappush

def solve():
	(n, s, y) = map(int, stdin.readline().split())
	a = stdin.readline().split()
	d = defaultdict(list)
	for (i, x) in enumerate(a):
		d[x].append(i)
	for i in range(1, n + 2):
		e = str(i)
		if e not in d:
			break
	q = [(-len(d[x]), x) for x in d.keys()]
	heapify(q)
	ans = [0] * n
	for i in range(s):
		(l, x) = heappop(q)
		ans[d[x].pop()] = x
		l += 1
		if l:
			heappush(q, (l, x))
	p = []
	while q:
		(l, x) = heappop(q)
		p.extend(d[x])
	if p:
		h = (n - s) // 2
		y = n - y
		q = p[h:] + p[:h]
		for (x, z) in zip(p, q):
			if a[x] == a[z]:
				if y:
					ans[x] = e
					y -= 1
				else:
					stdout.write('NO\n')
					return
			else:
				ans[x] = a[z]
		for i in range(n - s):
			if y and ans[p[i]] != e:
				ans[p[i]] = e
				y -= 1
	stdout.write('YES\n')
	stdout.write(' '.join(ans))
	stdout.write('\n')
T = int(stdin.readline())
for t in range(T):
	solve()


import collections
t = int(input())
for _ in range(t):
	(n, x, y) = map(int, input().split())
	b = [int(i) for i in input().split()]
	if x == n:
		print('YES')
		for i in b:
			print(i, end=' ')
		print()
		continue
	setB = set(b)
	noin = 1
	while noin in setB:
		noin += 1
	cnt = collections.deque(([i, j] for (i, j) in collections.Counter(b).most_common()))
	cnt2 = collections.deque()
	pos = [set() for _ in range(n + 2)]
	for i in range(len(b)):
		pos[b[i]].add(i)
	res = [-1] * n
	l = x
	while l > 0:
		i = cnt.popleft()
		i[1] -= 1
		if i[1] != 0:
			cnt2.appendleft(i)
		while not cnt or (cnt2 and cnt2[0][1] >= cnt[0][1]):
			cnt.appendleft(cnt2.popleft())
		p = pos[i[0]].pop()
		res[p] = i[0]
		l -= 1
	ml = cnt[0][1]
	remain = []
	while cnt:
		(i, j) = cnt.popleft()
		remain += [i] * j
	while cnt2:
		(i, j) = cnt2.popleft()
		remain += [i] * j
	if y - x > (len(remain) - ml) * 2:
		print('No')
		continue
	i = 0
	match = [0] * len(remain)
	for i in range(ml, ml + y - x):
		match[i % len(remain)] = remain[(i + ml) % len(remain)]
	for i in range(ml + y - x, ml + len(remain)):
		match[i % len(remain)] = noin
	for i in range(len(match)):
		p = pos[remain[i]].pop()
		res[p] = match[i]
	if l == 0:
		print('YES')
		for i in res:
			print(i, end=' ')
		print()
	else:
		print('No')


from sys import stdin, stdout
from collections import Counter, defaultdict
import heapq
t = int(stdin.readline())
for _ in range(t):
	(n, x, y) = map(int, stdin.readline().split())
	a = list(map(int, stdin.readline().split()))
	unused = set(list(range(1, n + 2))) - set(a)
	r = list(unused)[0]
	ans = [r] * n
	c = Counter(a)
	h = []
	ilist = defaultdict(list)
	for (i, k) in enumerate(a):
		ilist[k].append(i)
	for k in c:
		v = c[k]
		heapq.heappush(h, (-v, k))
	for _ in range(x):
		(v, k) = heapq.heappop(h)
		idx = ilist[k].pop()
		ans[idx] = k
		if v + 1 < 0:
			heapq.heappush(h, (v + 1, k))
	todo = y - x
	while todo > 0:
		(v1, k1) = heapq.heappop(h)
		idx1 = ilist[k1].pop()
		if not h:
			if todo == 1:
				for i in range(n):
					if ans[i] != r and ans[i] != a[i] and (ans[i] != k1):
						(ans[i], ans[idx1]) = (k1, ans[i])
						if ans[i] == a[i] or ans[idx1] == a[idx1]:
							(ans[i], ans[idx1]) = (ans[idx1], ans[i])
							continue
						todo -= 1
						break
			break
		(v2, k2) = heapq.heappop(h)
		idx2 = ilist[k2].pop()
		if todo > 1:
			(ans[idx1], ans[idx2]) = (k2, k1)
			if v1 + 1 < 0:
				heapq.heappush(h, (v1 + 1, k1))
			if v2 + 1 < 0:
				heapq.heappush(h, (v2 + 1, k2))
			todo -= 2
		else:
			ans[idx1] = k2
			todo -= 1
	if todo > 0:
		print('NO')
		continue
	print('YES')
	print(' '.join(map(str, ans)))


from collections import defaultdict
import heapq
T = int(input())
for _ in range(T):
	(N, A, B) = [int(x) for x in input().split(' ')]
	b = [int(x) for x in input().split(' ')]
	a = [0 for _ in range(N)]
	split = defaultdict(list)
	for (i, x) in enumerate(b):
		split[x].append((i, x))
	heap = []
	for x in split.values():
		heapq.heappush(heap, (-len(x), x))
	for _ in range(A):
		(_, cur) = heapq.heappop(heap)
		(i, x) = cur.pop()
		a[i] = x
		if len(cur):
			heapq.heappush(heap, (-len(cur), cur))
	if heap:
		rot = -heap[0][0]
		rem = [x for cur in heap for x in cur[1]]
		d = N - B
		if 2 * rot - d > len(rem):
			print('NO')
			continue
		heap[0] = (heap[0][0] + d, heap[0][1])
		rot = -min((x[0] for x in heap))
		unused = list(set(range(1, N + 2)) - set(b))[0]
		for i in range(d):
			rem[i] = (rem[i][0], unused)
		for i in range(len(rem)):
			a[rem[i][0]] = rem[(i - rot + len(rem)) % len(rem)][1]
	print('YES')
	print(' '.join((str(x) for x in a)))


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from fractions import Fraction
INF = float('inf')
mod = int(1000000000.0) + 7
for t in range(int(data())):
	(n, x, y) = mdata()
	a = mdata()
	d = dd(list)
	for i in range(n):
		d[a[i]].append(i)
	q = []
	for i in d.keys():
		heappush(q, [-len(d[i]), i])
	ind = 1
	while d[ind]:
		ind += 1
	ans = [ind] * n
	for i in range(x):
		(j, k) = heappop(q)
		i = d[k].pop()
		ans[i] = a[i]
		heappush(q, [-len(d[k]), k])
	l1 = []
	while q:
		(j, k) = heappop(q)
		l1 += d[k]
	ind = 0
	flag = True
	y -= x
	n -= x
	l1 = l1[::-1]
	while ind < y:
		if a[l1[ind]] == a[l1[(n // 2 + ind) % n]]:
			flag = False
			break
		ans[l1[ind]] = a[l1[(n // 2 + ind) % n]]
		y -= 1
		if ind >= y:
			break
		ans[l1[ind + n // 2 + n % 2]] = a[l1[ind]]
		ind += 1
	if flag == True:
		out('YES')
		outl(ans)
	else:
		out('NO')


from sys import stdin
from collections import deque
from itertools import chain
input = stdin.readline

def getint():
	return int(input())

def getints():
	return list(map(int, input().split()))

def getint1():
	return list(map(lambda x: int(x) - 1, input().split()))

def getstr():
	return input()[:-1]

def solve():
	(n, x, y) = getints()
	a = getints()
	ind = [[] for _ in range(n + 2)]
	for (i, color) in enumerate(a):
		ind[color].append(i)
	not_seen = 0
	for i in range(1, n + 2):
		if len(ind[i]) == 0:
			not_seen = i
			break
	max_cnt = max((len(g) for g in ind))
	table = [[] for _ in range(max_cnt + 1)]
	for (i, col) in enumerate(ind[1:], 1):
		if len(col) > 0:
			table[len(col)].append(i)
	ans = [0] * n
	for _ in range(x):
		assert len(table[max_cnt]) > 0
		color = table[max_cnt].pop()
		assert len(ind[color]) > 0
		i = ind[color].pop()
		ans[i] = color
		if max_cnt > 1:
			table[max_cnt - 1].append(color)
		if len(table[max_cnt]) == 0:
			max_cnt -= 1
	if 2 * max_cnt > 2 * n - x - y:
		print('NO')
		return
	rest = list(chain(*ind))
	(to_change, offset, m) = (n - y, n - x >> 1, n - x)
	for i in range(m):
		ans[rest[i]] = a[rest[(i + offset) % m]]
		if ans[rest[i]] == a[rest[i]]:
			ans[rest[i]] = not_seen
			to_change -= 1
	i = 0
	while to_change > 0:
		if ans[rest[i]] != not_seen:
			ans[rest[i]] = not_seen
			to_change -= 1
		i += 1
	print('YES')
	print(*ans)
for _ in range(getint()):
	solve()


from collections import deque
t = int(input())
for _ in range(t):
	(n, x, y) = map(int, input().split())
	a = list(map(int, input().split()))
	data = [[] for i in range(n + 2)]
	for i in range(n):
		data[a[i]].append(i)
	none = 0
	for i in range(1, n + 2):
		if not data[i]:
			none = i
			break
	temp = [[len(data[i]), i] for i in range(1, n + 2)]
	temp.sort(reverse=True)
	limit = (n - x) // 2
	unmatch = []
	pmatch = []
	id = 0
	count = n - y
	count = x
	while count and n >= id:
		if temp[id][0] > limit:
			pmatch.append(data[temp[id][1]].pop())
			temp[id][0] -= 1
			count -= 1
		else:
			id += 1
	id = 0
	while count:
		if data[temp[id][1]]:
			pmatch.append(data[temp[id][1]].pop())
			temp[id][0] -= 1
			count -= 1
		else:
			id += 1
	check = 0
	for i in range(n):
		check += min(n - x - temp[i][0], temp[i][0])
	if check >= y - x:
		print('YES')
		ans = [-1] * n
		for id in pmatch:
			ans[id] = a[id]
		count = y - x
		id = 0
		near = []
		while count:
			subcount = min(n - x - temp[id][0], temp[id][0])
			while subcount and count and data[temp[id][1]]:
				near.append(data[temp[id][1]].pop())
				subcount -= 1
				count -= 1
			if subcount == 0:
				id += 1
			elif not data[temp[id][1]]:
				id += 1
		newnear = []
		near = deque(near)
		cond = 0
		while near:
			if cond % 2 == 0:
				newnear.append(near.pop())
			else:
				newnear.append(near.popleft())
			cond = (cond + 1) % 2
		near = newnear
		wait = []
		pair = []
		while (len(near) > 1 or wait) and near:
			if not wait:
				wait.append(near.pop())
			elif a[wait[-1]] == a[near[-1]]:
				wait.append(near.pop())
			else:
				(u, v) = (wait.pop(), near.pop())
				pair.append((u, v))
		near += wait
		nnpair = []
		pos = []
		for i in range(1, n + 2):
			pos += data[i]
		for v in pos:
			if near:
				if a[v] != a[near[-1]]:
					u = near.pop()
					nnpair.append((u, v))
		if near:
			w = near[0]
			for i in range(len(pair)):
				(u, v) = pair[i]
				if a[u] != a[w] and a[v] != a[w]:
					pair[i] = (u, v, w)
					break
		for i in range(len(pair)):
			if len(pair[i]) == 2:
				(u, v) = pair[i]
				(ans[u], ans[v]) = (a[v], a[u])
			else:
				(u, v, w) = pair[i]
				(ans[u], ans[v], ans[w]) = (a[v], a[w], a[u])
		for (u, v) in nnpair:
			ans[u] = a[v]
		for i in range(n):
			if ans[i] == -1:
				ans[i] = none
		print(*ans)
	else:
		print('NO')


import io
import os
from collections import Counter, defaultdict, deque
from heapq import heappush, heappop, heapify
DEBUG = False

def solve(N, X, Y, B):
	match = X
	derange = Y - X
	if DEBUG:
		print()
		print('derange', derange, 'match', match)
		print('B')
		print(B)
	padVal = next(iter(set(range(1, N + 2)) - set(B)))
	A = [padVal for i in range(N)]
	if DEBUG:
		print('after pad')
		print(A)
	valToIndices = defaultdict(list)
	for (i, x) in enumerate(B):
		valToIndices[x].append(i)
	heap = []
	for (val, indices) in valToIndices.items():
		heap.append((-len(indices), val))
	heapify(heap)

	def take(count):
		ret = []
		readd = []
		for i in range(count):
			if not heap:
				break
			(negCount, val) = heappop(heap)
			i = valToIndices[val].pop()
			ret.append(i)
			if negCount != -1:
				readd.append((negCount + 1, val))
		for tup in readd:
			heappush(heap, tup)
		return ret
	while heap and match:
		(i,) = take(1)
		A[i] = B[i]
		match -= 1
	assert match == 0
	if DEBUG:
		print('after match')
		print(A)
	while heap and derange > 1:
		indices = take(2)
		if len(indices) != 2:
			return 'NO'
		(i, j) = indices
		(A[i], A[j]) = (B[j], B[i])
		derange -= 2
	if derange == 1:
		(j,) = take(1)
		for (i, x) in enumerate(A):
			if A[i] != B[i] and A[i] != B[j] and (B[i] != B[j]):
				(A[i], A[j]) = (B[j], A[i])
				derange -= 1
				break
		else:
			return 'NO'
	assert derange == 0
	if DEBUG:
		print('after derange')
		print(A)
	if DEBUG:
		aFreq = Counter(A)
		bFreq = Counter(B)
		xCheck = sum((1 for (a, b) in zip(A, B) if a == b))
		yCheck = sum((min(aFreq[k], bFreq[k]) for k in aFreq.keys() & bFreq.keys()))
		assert xCheck == X
		assert yCheck == Y
	return 'YES\n' + ' '.join((str(x) for x in A))
if DEBUG:
	import random
	random.seed(0)
	for _ in range(100000):
		N = random.randint(1, 10)
		A = [random.randint(1, N + 1) for i in range(N)]
		B = [random.randint(1, N + 1) for i in range(N)]
		X = sum((1 for (a, b) in zip(A, B) if a == b))
		aFreq = Counter(A)
		bFreq = Counter(B)
		Y = sum((min(aFreq[k], bFreq[k]) for k in aFreq.keys() & bFreq.keys()))
		if solve(N, X, Y, B) == 'NO':
			print('expected')
			print(B)
			print(A)
			assert False
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for tc in range(1, T + 1):
	(N, X, Y) = [int(x) for x in input().split()]
	B = [int(x) for x in input().split()]
	ans = solve(N, X, Y, B)
	print(ans)


from sys import stdin, stdout
import heapq

def Mastermind(n, x, y, b_a):
	ans = [-1] * n
	b_s = set(b_a)
	mex = 1
	while mex in b_s:
		mex += 1
	fq_d = {}
	for i in range(len(b_a)):
		if b_a[i] not in fq_d:
			fq_d[b_a[i]] = []
		fq_d[b_a[i]].append(i)
	fq_h = []
	for key in fq_d:
		heapq.heappush(fq_h, (-len(fq_d[key]), key, fq_d[key]))
	for _ in range(x):
		(l, v, f_a) = heapq.heappop(fq_h)
		ans[f_a.pop()] = v
		l += 1
		if l < 0:
			heapq.heappush(fq_h, (l, v, f_a))
	if x == n:
		return ans
	z = n - y
	shift_a = []
	for fq in fq_h:
		for idx in fq[2]:
			shift_a.append([idx, fq[1]])
	offset = -fq_h[0][0]
	idx_a = []
	for i in range(len(shift_a)):
		shift = shift_a[i]
		nidx = (i + offset) % (n - x)
		nv = shift_a[nidx][1]
		if shift[1] == nv:
			if z == 0:
				return []
			z -= 1
			ans[shift_a[nidx][0]] = mex
		else:
			idx_a.append(shift_a[nidx][0])
			ans[shift_a[nidx][0]] = shift[1]
	while z > 0:
		if not idx_a:
			return []
		ans[idx_a.pop()] = mex
		z -= 1
	return ans
t = int(stdin.readline())
for _ in range(t):
	(n, x, y) = map(int, stdin.readline().split())
	b_a = list(map(int, stdin.readline().split()))
	ans = Mastermind(n, x, y, b_a)
	if ans:
		stdout.write('Yes\n')
		stdout.write(' '.join(map(str, ans)) + '\n')
	else:
		stdout.write('No\n')


from heapq import *
from collections import Counter
import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
for _ in range(II()):
	ng = False
	(n, x, y) = MI()
	bb = LI()
	use = [False] * (n + 1)
	for b in bb:
		use[b - 1] = True
	unuse = 0
	for b in range(1, n + 2):
		if use[b - 1] == False:
			unuse = b
			break
	aa = [unuse] * n
	cnt = [[] for _ in range(n + 2)]
	for (i, b) in enumerate(bb):
		cnt[b].append(i)
	hp = []
	for (b, ii) in enumerate(cnt):
		if not ii:
			continue
		heappush(hp, [-len(ii)] + [b] + ii)
	if (y - x) % 2:
		if len(hp) > 2 and y - x > 2:
			ii0 = heappop(hp)
			ii1 = heappop(hp)
			ii2 = heappop(hp)
			b0 = ii0[1]
			b1 = ii1[1]
			b2 = ii2[1]
			i0 = ii0.pop()
			i1 = ii1.pop()
			i2 = ii2.pop()
			ii0[0] += 1
			ii1[0] += 1
			ii2[0] += 1
			if ii0[0] < 0:
				heappush(hp, ii0)
			if ii1[0] < 0:
				heappush(hp, ii1)
			if ii2[0] < 0:
				heappush(hp, ii2)
			aa[i0] = b1
			aa[i1] = b2
			aa[i2] = b0
			y -= 3
		elif len(hp) > 1:
			ii0 = heappop(hp)
			ii1 = heappop(hp)
			b0 = ii0[1]
			b1 = ii1[1]
			i0 = ii0.pop()
			i1 = ii1.pop()
			ii0[0] += 1
			ii1[0] += 1
			if ii0[0] < 0:
				heappush(hp, ii0)
			if ii1[0] < 0:
				heappush(hp, ii1)
			aa[i0] = b1
			y -= 1
		else:
			print('NO')
			continue
	for _ in range((y - x) // 2):
		if len(hp) < 2:
			ng = True
			break
		ii0 = heappop(hp)
		ii1 = heappop(hp)
		b0 = ii0[1]
		b1 = ii1[1]
		i0 = ii0.pop()
		i1 = ii1.pop()
		ii0[0] += 1
		ii1[0] += 1
		if ii0[0] < 0:
			heappush(hp, ii0)
		if ii1[0] < 0:
			heappush(hp, ii1)
		aa[i0] = b1
		aa[i1] = b0
	if ng:
		print('NO')
		continue
	ii0 = []
	for _ in range(x):
		if len(ii0) < 3:
			if not hp:
				ng = True
				break
			else:
				ii0 = heappop(hp)
		b0 = ii0[1]
		i0 = ii0.pop()
		aa[i0] = b0
	if ng:
		print('NO')
		continue
	print('YES')
	print(*aa)


t = int(input())
for q in range(t):
	(n, x, y) = map(int, input().split())
	Bob = list(map(int, input().split()))
	Cnt = [[0, i] for i in range(n + 1)]
	Ans = [-1] * n
	Occ = [[] for i in range(n + 1)]
	for i in range(n):
		Bob[i] -= 1
		Cnt[Bob[i]][0] += 1
		Occ[Bob[i]].append(i)
	Cnt.sort(reverse=True)
	lvl = Cnt[0][0]
	i = 0
	xcpy = x
	while x > 0:
		while x > 0 and Cnt[i][0] >= lvl:
			Cnt[i][0] -= 1
			col = Cnt[i][1]
			Ans[Occ[col].pop()] = col
			x -= 1
		i += 1
		if i == n or Cnt[i][0] < lvl:
			lvl = Cnt[0][0]
			i = 0
	Cnt.sort(reverse=True)
	x = xcpy
	if Cnt[0][0] * 2 - (n - x) > n - y:
		print('NO')
		continue
	Pos = []
	Clr = []
	for i in range(n):
		if Ans[i] == -1:
			Pos.append([Bob[i], i])
			Clr.append(Bob[i])
	m = len(Pos)
	Pos.sort()
	Clr.sort()
	offset = m // 2
	nocnt = n - y
	nocolor = Cnt[-1][1]
	for i in range(m):
		pos = Pos[i][1]
		c = Clr[(offset + i) % m]
		if i + nocnt == m:
			Ans[pos] = nocolor
			nocnt -= 1
			continue
		if Pos[i][0] == c:
			assert nocnt > 0
			Ans[pos] = nocolor
			nocnt -= 1
		else:
			Ans[pos] = c
	assert nocnt == 0
	print('YES')
	for c in Ans:
		print(c + 1, end=' ')
	print()


from collections import defaultdict

def solve():
	(n, x, y) = [int(p) for p in input().split()]
	b = [int(p) for p in input().split()]
	b_set = set(b)
	mex = next((i for i in range(1, n + 2) if i not in b_set))
	ans = [0 for p in b]
	b_dict = defaultdict(list)
	for (i, p) in enumerate(b):
		b_dict[p].append(i)
	order = []
	while b_dict:
		for k in list(b_dict.keys()):
			order.append(b_dict[k].pop())
			if not b_dict[k]:
				del b_dict[k]
	for _ in range(x):
		i = order.pop()
		ans[i] = b[i]
	indices = []
	for (i, p) in enumerate(ans):
		if p == 0:
			indices.append(i)
	indices.sort(key=lambda i: b[i])
	for i in range(len(indices)):
		j = (i + len(indices) // 2) % len(indices)
		ans[indices[j]] = b[indices[i]]
	cnt = 0
	rm = n - y
	for i in range(n):
		if b[i] == ans[i]:
			cnt += 1
			if cnt > x:
				ans[i] = mex
				rm -= 1
	if rm < 0:
		print('NO')
		return
	for i in range(n):
		if rm == 0:
			break
		if ans[i] != b[i] and ans[i] != mex:
			ans[i] = mex
			rm -= 1
	print('YES')
	print(' '.join((str(p) for p in ans)))
t = int(input())
for _ in range(t):
	solve()