n,a,b,c = map(int,input().split())
ss=['' for _ in range(n)]
ans=['' for _ in range(n)]
wa=a+b+c
for i in range(n):
    s=input()
    ss[i]=s
i=0
if wa==0:
    print('No')
    exit()
elif wa==1:
    for s in ss:
        if s=='AB':
            if c:
                print('No')
                exit()
            elif b:
                a+=1
                b-=1
                ans[i]='A'
            elif a:
                b+=1
                a-=1
                ans[i]='B'
        elif s=='AC':
            if b:
                print('No')
                exit()
            elif a:
                c+=1
                a-=1
                ans[i]='C'
            elif c:
                a+=1
                c-=1
                ans[i]='A'
        elif s=='BC':
            if a:
                print('No')
                exit()
            elif b:
                c+=1
                b-=1
                ans[i]='C'
            elif c:
                b+=1
                c-=1
                ans[i]='B'
        i+=1
elif wa==2:
    for s in ss:
        if s=='AB':
            if a==0 and b==0:
                print('No')
                exit()
            elif a==0:
                a+=1
                b-=1
                ans[i]='A'
            elif b==0:
                b+=1
                a-=1
                ans[i]='B'
            elif a==1 and b==1:
                if i==n-1:
                    ans[i]='A'
                else:
                    if ss[i+1]=='AC' or ss[i+1]=='AB':
                        a+=1
                        b-=1
                        ans[i]='A'
                    elif ss[i+1]=='BC':
                        b+=1
                        a-=1
                        ans[i]='B'
        elif s=='AC':
            if a==0 and c==0:
                print('No')
                exit()
            elif a==0:
                a+=1
                c-=1
                ans[i]='A'
            elif c==0:
                c+=1
                a-=1
                ans[i]='C'
            elif a==1 and c==1:
                if i==n-1:
                    ans[i]='A'
                else:
                    if ss[i+1]=='AC' or ss[i+1]=='AB':
                        a+=1
                        c-=1
                        ans[i]='A'
                    elif ss[i+1]=='BC':
                        c+=1
                        a-=1
                        ans[i]='C'
        elif s=='BC':
            if b==0 and c==0:
                print('No')
                exit()
            elif b==0:
                b+=1
                c-=1
                ans[i]='B'
            elif c==0:
                c+=1
                b-=1
                ans[i]='C'
            elif b==1 and c==1:
                if i==n-1:
                    ans[i]='B'
                else:
                    if ss[i+1]=='BC' or ss[i+1]=='AB':
                        b+=1
                        c-=1
                        ans[i]='B'
                    elif ss[i+1]=='AC':
                        c+=1
                        b-=1
                        ans[i]='C'
        i+=1
elif wa>2:
    for i in range(n):
        s=ss[i]
        if s=='AB':
            if a==0 and b==0:
                print('No')
                exit()
            elif a==0:
                a+=1
                b-=1
                ans[i]='A'
            elif b==0:
                b+=1
                a-=1
                ans[i]='B'
            else:
                if i==n-1:
                    ans[i]='A'
                    a+=1
                    b-=1
                else:
                    if b>=a:
                        a+=1
                        b-=1
                        ans[i]='A'
                    else:
                        b+=1
                        a-=1
                        ans[i]='B'
        elif s=='AC':
            if a==0 and c==0:
                print('No')
                exit()
            elif a==0:
                a+=1
                c-=1
                ans[i]='A'
            elif c==0:
                c+=1
                a-=1
                ans[i]='C'
            else:
                if i==n-1:
                    ans[i]='A'
                    a+=1
                    c-=1
                else:
                    if c>=a:
                        a+=1
                        c-=1
                        ans[i]='A'
                    else:
                        c+=1
                        a-=1
                        ans[i]='C'
        elif s=='BC':
            if b==0 and c==0:
                print('No')
                exit()
            elif b==0:
                b+=1
                c-=1
                ans[i]='B'
            elif c==0:
                c+=1
                b-=1
                ans[i]='C'
            else:
                if i==n-1:
                    ans[i]='B'
                    b+=1
                    c-=1
                else:
                    if c>=b:
                        b+=1
                        c-=1
                        ans[i]='B'
                    else:
                        c+=1
                        b-=1
                        ans[i]='C'
        #print(i,a,b,c)
print('Yes')
for x in ans:
    print(x)

Measured memory_bytes: 16988