import sys
sys.setrecursionlimit(2147483647)
INF=float('inf')
MOD=10**9+7

n,a,b,c=map(int,input().split())

s=[input() for _ in range(n)]

#不可能な場合
if a+b+c==0:
    print("No")
    exit()
elif a+b+c==1:
    result=[]
    for order in s:
        if "AB" == order:
            if c==1:
                print("No")
                exit()
            elif a==1:
                a-=1
                b+=1
                result.append("B")
            else:
                b-=1
                a+=1
                result.append("A")
        elif "AC" == order:
            if b==1:
                print("No")
                exit()
            elif a==1:
                a-=1
                c+=1
                result.append("C")
            else:
                c-=1
                a+=1
                result.append("A")
        elif "BC" == order:
            if a==1:
                print("No")
                exit()
            elif b==1:
                b-=1
                c+=1
                result.append("C")
            else:
                c-=1
                b+=1
                result.append("B")
    print("Yes")
    for item in result:
        print(item)
    exit()

else:
    result=[]
    for index,order in enumerate(s):
        if "AB" == order:
            if a==0 and b==0:
                print("No")
                exit()
            elif a==1 and b==1:
                if index <n-1:
                    if s[index+1]=="AB":
                        result.append("B")
                        a-=1
                        b+=1
                    elif s[index+1]=="AC":
                        result.append("A")
                        a+=1
                        b-=1
                    elif s[index+1]=="BC":
                        result.append("B")
                        a-=1
                        b+=1
                else:
                    a-=1
                    b+=1
                    result.append("B")
            else:
                if a<b:
                    a+=1
                    b-=1
                    result.append("A")
                else:
                    a-=1
                    b+=1
                    result.append("B")
                    
#ここっからまた変わるよ
        elif "AC" == order:
            if a==0 and c==0:
                print("No")
                exit()
            elif a==1 and c==1:
                if index <n-1:
                    if s[index+1]=="AB":
                        result.append("A")
                        a+=1
                        c-=1
                    elif s[index+1]=="AC":
                        result.append("A")
                        a+=1
                        c-=1
                    elif s[index+1]=="BC":
                        result.append("C")
                        a-=1
                        c+=1
                else:
                    a-=1
                    c+=1
                    result.append("C")
            else:
                if a<c:
                    a+=1
                    c-=1
                    result.append("A")
                else:
                    a-=1
                    c+=1
                    result.append("C")

#ここっからまた変わるよ
        elif "BC" == order:
            if b==0 and c==0:
                print("No")
                exit()
            elif b==1 and c==1:
                if index <n-1:
                    if s[index+1]=="AB":
                        result.append("B")
                        b+=1
                        c-=1
                    elif s[index+1]=="AC":
                        result.append("C")
                        c+=1
                        b-=1
                    elif s[index+1]=="BC":
                        result.append("C")
                        b-=1
                        c+=1
                else:
                    c-=1
                    b+=1
                    result.append("B")
            else:
                if b<c:
                    b+=1
                    c-=1
                    result.append("B")
                else:
                    b-=1
                    c+=1
                    result.append("C")

        
    print("Yes")
    for item in result:
        print(item)
    exit()

    



        

        









Measured memory_bytes: 86576