n, a, b, c = map(int,input().split())
slist=[]
for i in range(n):
    slist.append(input())

if a==0 and b==0 and c==0:
    print("No")
elif a==0 and b==0 and slist[0]=="AB":
    print("No")
elif a==0 and c==0 and slist[0]=="AC":
    print("No")
elif b==0 and c==0 and slist[0]=="BC":
    print("No")
else:
    cup=[a, b, c]
    answer=""
    ng=0
    for i in range(n):
        now=slist[i]
        if now=="AB":
            mode1=2
        elif now=="AC":
            mode1=1
        else:
            mode1=0
        if i==n-1:
            mode2=3
        else:
            if slist[i+1]=="AB":
                mode2=2
            elif slist[i+1]=="AC":
                mode2=1
            else:
                mode2=0
        
        if mode2==3:
            if now=="AB":
                if cup[0]==0:
                    if cup[1]==0:
                        ng=1
                    else:
                        answer+="A"
                else:
                    answer+="B"
            elif now=="BC":
                if cup[1]==0:
                    if cup[2]==0:
                        ng=1
                    else:
                        answer+="B"
                else:
                    answer+="C"
            else:
                if cup[0]==0:
                    if cup[2]==0:
                        ng=1
                    else:
                        answer+="A"
                else:
                    answer+="C"
        
        elif mode1==mode2:
            if now=="AB":
                if cup[0]==0:
                    if cup[1]==0:
                        ng=1
                    else:
                        answer+="A"
                        cup[0]+=1
                        cup[1]-=1
                else:
                    answer+="B"
                    cup[1]+=1
                    cup[0]-=1
            elif now=="BC":
                if cup[1]==0:
                    if cup[2]==0:
                        ng=1
                    else:
                        answer+="B"
                        cup[1]+=1
                        cup[2]-=1
                else:
                    answer+="C"
                    cup[2]+=1
                    cup[1]-=1
            else:
                if cup[0]==0:
                    if cup[2]==0:
                        ng=1
                    else:
                        answer+="A"
                        cup[0]+=1
                        cup[2]-=1
                else:
                    answer+="C"
                    cup[2]+=1
                    cup[0]-=1
        
        else:
            if now=="AB" and cup[0]==0 and cup[1]==0:
                ng=1
            elif now=="BC" and cup[2]==0 and cup[1]==0:
                ng=1
            elif now=="AC" and cup[0]==0 and cup[2]==0:
                ng=1
            else:
                if now=="AB":
                    if cup[0]==0:
                        answer+="A"
                        cup[0]+=1
                        cup[1]-=1
                    elif cup[1]==0:
                        answer+="B"
                        cup[1]+=1
                        cup[0]-=1
                    else:
                        if slist[i+1]=="AC":
                            cup[0]+=1
                            cup[1]-=1
                            answer+="A"
                        else:
                            cup[1]+=1
                            cup[0]-=1
                            answer+="B"
                
                elif now=="BC":
                    if cup[1]==0:
                        answer+="B"
                        cup[1]+=1
                        cup[2]-=1
                    elif cup[2]==0:
                        answer+="C"
                        cup[2]+=1
                        cup[1]-=1
                    else:
                        if slist[i+1]=="AC":
                            cup[2]+=1
                            cup[1]-=1
                            answer+="C"
                        else:
                            cup[1]+=1
                            cup[2]-=1
                            answer+="B"
                
                else:
                    if cup[0]==0:
                        answer+="A"
                        cup[0]+=1
                        cup[2]-=1
                    elif cup[2]==0:
                        answer+="C"
                        cup[2]+=1
                        cup[0]-=1
                    else:
                        if slist[i+1]=="AB":
                            cup[0]+=1
                            cup[2]-=1
                            answer+="A"
                        else:
                            cup[2]+=1
                            cup[0]-=1
                            answer+="C"
                            
    if ng==1:
        print("No")
    else:
        print("Yes")
        for i in range(len(answer)):
            print(answer[i])

Measured memory_bytes: 133428