n,a,b,c = map(int,input().split())
ss = [input()for i in range(n)]
ok = True
ans = []
for i in range(n):
    s = ss[i]
    if s == 'AB':
        if a == 1 and b == 1 and c == 0:
            if  ss[i+1] == 'AC':
                ans.append('A')
                a += 1
                b -= 1
                continue
            elif ss[i+1] == 'BC':
                ans.append('B')
                b += 1
                a -= 1
                continue
            
            
        if a == 0 and b == 0:
            ok = False
            break
        
        if a > b:
            b +=1
            a -= 1
            ans.append('B')
        else:
            b -= 1
            a += 1
            ans.append('A')
            
    elif s == 'AC':
        if a == 1 and b == 0 and c == 1:
            if  ss[i+1] == 'AB':
                ans.append('A')
                a += 1
                c -= 1
                continue
            elif ss[i+1] == 'BC':
                ans.append('C')
                c += 1
                a -= 1
                continue
            
        if a == 0 and c == 0:
            ok = False
            break
        
        if a > c:
            c +=1
            a -= 1
            ans.append('C')
        else:
            c -= 1
            a += 1
            ans.append('A')
            
        
    else:
        if a == 0 and b == 1 and c == 1:
            if  ss[i+1] == 'AC':
                ans.append('C')
                c += 1
                b -= 1
                continue
            elif ss[i+1] == 'AB':
                ans.append('B')
                b += 1
                c -= 1
                continue
        if c == 0 and b == 0:
            ok = False
            break
        
        if c > b:
            b +=1
            c -= 1
            ans.append('B')
        else:
            b -= 1
            c += 1
            ans.append('C')
if ok:
    print('Yes')
    for x in ans:
        print(x)
else:print('No')


### FIXED CODE ###

n,a,b,c = map(int,input().split())
ss = [input()for i in range(n)]
ok = True
ans = []
for i in range(n):
    s = ss[i]
    if s == 'AB':
        if a == 1 and b == 1 and c == 0:
            if  i+1 < n and ss[i+1] == 'AC':
                ans.append('A')
                a += 1
                b -= 1
                continue
            if i + 1 < n and ss[i+1] == 'BC':
                ans.append('B')
                b += 1
                a -= 1
                continue
            
            
        if a == 0 and b == 0:
            ok = False
            break
        
        if a > b:
            b +=1
            a -= 1
            ans.append('B')
        else:
            b -= 1
            a += 1
            ans.append('A')
            
    elif s == 'AC':
        if a == 1 and b == 0 and c == 1:
            if  i+1 < n and ss[i+1] == 'AB':
                ans.append('A')
                a += 1
                c -= 1
                continue
            if i + 1 < n and ss[i+1] == 'BC':
                ans.append('C')
                c += 1
                a -= 1
                continue
            
        if a == 0 and c == 0:
            ok = False
            break
        
        if a > c:
            c +=1
            a -= 1
            ans.append('C')
        else:
            c -= 1
            a += 1
            ans.append('A')
            
        
    else:
        if a == 0 and b == 1 and c == 1:
            if i+1 < n and  ss[i+1] == 'AC':
                ans.append('C')
                c += 1
                b -= 1
                continue
            if  i+ 1 < n and ss[i+1] == 'AB':
                ans.append('B')
                b += 1
                c -= 1
                continue
        if c == 0 and b == 0:
            ok = False
            break
        
        if c > b:
            b +=1
            c -= 1
            ans.append('B')
        else:
            b -= 1
            c += 1
            ans.append('C')
if ok:
    print('Yes')
    for x in ans:
        print(x)
else:print('No')