# -*- coding: utf-8 -*-
import sys
from collections import deque
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N,A,B,C=map(int,input().split())
    n=[A,B,C]
    d={'AB':0,'BC':1,'AC':2}
    before=[-1,-1,-1]
    ans=[-1]*N
    for i in range(N):
        s=input()
        if n[d[s]]==0 and n[(d[s]+1)%3]==0:
            if before[d[s]]!=-1:
                n[d[s]]+=1
                n[(d[s]-1)%3]-=1
                before[d[s]]=-1
                ans[before[d[s]]]=(d[s]-1)%3
            print('No')
            exit()
        if n[d[s]]==0:
            ans[i]=d[s]
            n[d[s]]+=1
            n[(d[s]+1)%3]-=1
        elif n[(d[s]+1)%3]==0:
            ans[i]=(d[s]+1)%3
            n[d[s]]-=1
            n[(d[s]+1)%3]+=1
        else:
            ans[i]=d[s]
            before[(d[s]+1)%3]=i
    print('Yes')
    d2=['A','B','C']
    for a,b in ans:
        print(d2[a])
                
                    

if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
from collections import deque
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N,A,B,C=map(int,input().split())
    n=[A,B,C]
    d={'AB':0,'BC':1,'AC':2}
    before=[[],[],[]]
    ans=[-1]*N
    for i in range(N):
        s=input()
        if n[d[s]]==0 and n[(d[s]+1)%3]==0:
            if before[d[s]] and before[(d[s]+1)%3]:
                if before[d[s]][-1][0]>before[(d[s]+1)%3][-1][0]:
                    k,l=before[d[s]].pop()
                    n[d[s]]+=2
                    n[l]-=2
                    ans[k]=d[s]
                else:
                    k,l=before[(d[s]+1)%3].pop()
                    n[(d[s]+1)%3]+=2
                    n[l]-=2
                    ans[k]=(d[s]+1)%3
            elif before[d[s]] or before[(d[s]+1)%3]:
                if before[d[s]]:
                    k,l=before[d[s]].pop()
                    n[d[s]]+=2
                    n[l]-=2
                    ans[k]=d[s]
                elif before[(d[s]+1)%3]:
                    k,l=before[(d[s]+1)%3].pop()
                    n[(d[s]+1)%3]+=2
                    n[l]-=2
                    ans[k]=(d[s]+1)%3
            else:
                print('No')
                exit()
        if n[d[s]]==0:
            ans[i]=d[s]
            n[d[s]]+=1
            n[(d[s]+1)%3]-=1
        elif n[(d[s]+1)%3]==0:
            ans[i]=(d[s]+1)%3
            n[d[s]]-=1
            n[(d[s]+1)%3]+=1
        else:
            if n[d[s]]<n[(d[s]+1)%3]:
                ans[i]=d[s]
                n[d[s]]+=1
                n[(d[s]+1)%3]-=1
                before[(d[s]+1)%3].append((i,d[s]))
            else:
                ans[i]=(d[s]+1)%3
                n[d[s]]-=1
                n[(d[s]+1)%3]+=1
                before[d[s]].append((i,(d[s]+1)%3))
    print('Yes')
    d2=['A','B','C']
    for a in ans:
        print(d2[a])

if __name__ == '__main__':
    main()