MOD = 10 ** 9 + 7
INF = 10 ** 11
import sys
sys.setrecursionlimit(100000000)

def main():
    N,A,B,C = map(int,input().split())
    S = [input() for _ in range(N)]

    ans = []
    for i in range(N):
        s = S[i]
        if s == 'AB':
            if A > 1 and B > 1:
                if A > B:
                    A -= 1
                    B += 1
                    ans.append('B')
                else:
                    B -= 1
                    A += 1
                    ans.append('A')
            elif A == 1 and B > 1:
                B -= 1
                A += 1
                ans.append('A')
            elif A > 1  and B == 1:
                A -= 1
                B += 1
                ans.append('B')
            elif A == 1 and B == 1:
                if i + 1 < N:
                    if S[i + 1] == 'AB':
                        A += 1
                        B -= 1
                        ans.append('A')
                    elif S[i + 1] == 'BC':
                        B += 1
                        A -= 1
                        ans.append('B')
                    else:
                        A += 1
                        B -= 1
                        ans.append('A')
                else:
                    ans.append('A')
            elif A == 0 and B == 0:
                print('No')
                return
            elif A == 0:
                A += 1
                B -= 1
                ans.append('A')
            elif B == 0:
                B += 1
                A -= 1
                ans.append('B')
        
        elif s == 'BC':
            if C > 1 and B > 1:
                if C > B:
                    C -= 1
                    B += 1
                    ans.append('B')
                else:
                    B -= 1
                    C += 1
                    ans.append('C')
            elif C == 1 and B > 1:
                B -= 1
                C += 1
                ans.append('C')
            elif C > 1  and B == 1:
                C -= 1
                B += 1
                ans.append('B')
            elif C == 1 and B == 1:
                if i + 1 < N:
                    if S[i + 1] == 'AB':
                        C -= 1
                        B += 1
                        ans.append('B')
                    elif S[i + 1] == 'BC':
                        B += 1
                        C -= 1
                        ans.append('B')
                    else:
                        C += 1
                        B -= 1
                        ans.append('C')
                else:
                    ans.append('B')
            elif C == 0 and B == 0:
                print('No')
                return
            elif C == 0:
                C += 1
                B -= 1
                ans.append('C')
            elif B == 0:
                B += 1
                C -= 1
                ans.append('B')
        
        elif s == 'AC':
            if A > 1 and C > 1:
                if A > C:
                    A -= 1
                    C += 1
                    ans.append('C')
                else:
                    C -= 1
                    A += 1
                    ans.append('A')
            elif A == 1 and C > 1:
                C -= 1
                A += 1
                ans.append('A')
            elif A > 1  and C == 1:
                A -= 1
                C += 1
                ans.append('C')
            elif A == 1 and C == 1:
                if i + 1 < N:
                    if S[i + 1] == 'AB':
                        A += 1
                        C -= 1
                        ans.append('A')
                    elif S[i + 1] == 'BC':
                        C += 1
                        A -= 1
                        ans.append('C')
                    else:
                        A += 1
                        C -= 1
                        ans.append('A')
                else:
                    ans.append('A')
            elif A == 0 and C == 0:
                print('No')
                return
            elif A == 0:
                A += 1
                C -= 1
                ans.append('A')
            elif C == 0:
                C += 1
                A -= 1
                ans.append('C')

    print('Yes')
    print(*ans,sep = '\n')
if __name__ == '__main__':
    main()


Measured memory_bytes: 18560