n,a,b,c=map(int,input().split())
s=[input() for _ in range(n)]
if a+b+c==0:
    print("No")
elif a+b+c==1:
    choice=[]
    for si in s:
        if si=="AB":
            if c==1:
                print("No")
                exit()
            elif a==1:
                a-=1
                b+=1
                choice.append("B")
            else:
                a+=1
                b-=1
                choice.append("A")
        elif si=="AC":
            if b==1:
                print("No")
                exit()
            elif a==1:
                a-=1
                c+=1
                choice.append("C")
            else:
                a+=1
                c-=1
                choice.append("A")
        else:
            if a==1:
                print("No")
                exit()
            elif b==1:
                b-=1
                c+=1
                choice.append("C")
            else:
                b+=1
                c-=1
                choice.append("B")
    print("Yes")
    for ch in choice:
        print(ch)
else:
    choice=[]
    if s[0]=="AB":
        if a==0 and b==0:
            print("No")
            exit()
    elif s[0]=="AC":
        if a==0 and c==0:
            print("No")
            exit()
    else:
        if b==0 and c==0:
            print("No")
            exit()
    for i in range(n):
        if a+b+c>=3:
            if s[i]=="AB":
                if a>=b:
                    a-=1
                    b+=1
                    choice.append("B")
                else:
                    a+=1
                    b-=1
                    choice.append("A")
            elif s[i]=="AC":
                if a>=c:
                    a-=1
                    c+=1
                    choice.append("C")
                else:
                    a+=1
                    c-=1
                    choice.append("A")
            else:
                if b>=c:
                    b-=1
                    c+=1
                    choice.append("C")
                else:
                    b+=1
                    c-=1
                    choice.append("B")
        else:
            if i<n-1:
                #print(a,b,c)
                if s[i]=="AB":
                    if a==b:
                        if s[i+1]=="AB" or s[i+1]=="BC":
                            a-=1
                            b+=1
                            choice.append("B")
                        else:
                            a+=1
                            b-=1
                            choice.append("A")
                    elif b>a:
                        a+=1
                        b-=1
                        choice.append("A")
                    else:
                        a-=1
                        b+=1
                        choice.append("B")
                        #print(a,b,c)
                elif s[i]=="AC":
                    if a==c:
                        if s[i+1]=="AC" or s[i+1]=="BC":
                            a-=1
                            c+=1
                            choice.append("C")
                        else:
                            a+=1
                            c-=1
                            choice.append("A")
                    elif c>a:
                        a+=1
                        c-=1
                        choice.append("A")
                    else:
                        a-=1
                        c+=1
                        choice.append("C")
                else:
                    if b==c:
                        if s[i+1]=="BC" or s[i+1]=="AC":
                            b-=1
                            c+=1
                            choice.append("C")
                        else:
                            b+=1
                            c-=1
                            choice.append("B")
                    elif b>c:
                        b-=1
                        c+=1
                        choice.append("C")
                    else:
                        b+=1
                        c-=1
                        choice.append("B")
            else:
                if s[i]=="AB":
                    if a>=b:
                        a-=1
                        b+=1
                        choice.append("B")
                    else:
                        a+=1
                        b-=1
                        choice.append("A")
                elif s[i]=="AC":
                    if a>=c:
                        a-=1
                        c+=1
                        choice.append("C")
                    else:
                        a+=1
                        c-=1
                        choice.append("A")
                else:
                    if b>=c:
                        b-=1
                        c+=1
                        choice.append("C")
                    else:
                        b+=1
                        c-=1
                        choice.append("B")
    print("Yes")
    #print(a,b,c)
    for ch in choice:
        print(ch)

Measured memory_bytes: 17140