N=io.read"*n"
A=io.read"*n"
B=io.read"*n"
C=io.read"*n"
io.read()
s={}
for i=1,N do
	table.insert(s,io.read())
end

r={}
for i=1,N do
	if(s[i]=="AB")then
		if(A==0 and B==0)then
			print("No") return
		end
		if(A<B)then A=A+1 B=B-1 table.insert(r,"A")
		else A=A-1 B=B+1 table.insert(r,"B")end
	elseif(s[i]=="AC")then
		if(A==0 and C==0)then
			print("No") return
		end
		if(A<C)then A=A+1 C=C-1 table.insert(r,"A")
		else A=A-1 C=C+1 table.insert(r,"C")end
	else
		if(B==0 and C==0)then
			print("No") return
		end
		if(B<C)then B=B+1 C=C-1 table.insert(r,"B")
		else B=B-1 C=C+1 table.insert(r,"C")end
	end
end
print("Yes")
for _,v in ipairs(r)do
print(v)
end