import sys ins = list(map(int, sys.stdin.buffer.read().split())) ins.reverse() for _ in range(ins.pop()): n, m = ins.pop(), ins.pop() d = {ins.pop() : 1 for _ in range(n)} for _ in range(m): x = ins.pop() d[x] = d.get(x, 0) | 2 v = [[], [], []] for x, t in d.items(): v[t - 1].append(x) ans = [] if not v[2]: if v[0] and v[1]: print('No') continue elif v[0]: ans = [(0, x) for x in v[0]] else: ans = [(1, x) for x in v[1]] else: for x in v[2]: if not ans: ans.extend((0, x) for x in v[0]) ans.append((0, x)) ans.append((1, x)) ans.extend((1, x) for x in v[1]) else: t = ans[-1][0] ans.append((t, x)) ans.append((t ^ 1, x)) print('Yes') for t, x in ans: print(('Red' if t == 0 else 'Blue'), x)