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