N,A,B,C = map(int,input().split())
s = [input() for i in range(N)]

if A+B+C == 0:
    print('No')
    exit()

D = []

if A+B+C == 1:
    for i in range(N):
        if (A == 1 and s[i] == 'BC') or (B == 1 and s[i] == 'AC') or (C == 1 and s[i] == 'AB'):
            print('No')
            exit()
        else:
            if A == 1:
                if s[i] == 'AB':
                    A = 0
                    B = 1
                    D.append('B')
                else:
                    A = 0
                    C = 1
                    D.append('C')
            elif B == 1:
                if s[i] == 'AB':
                    B = 0
                    A = 1
                    D.append('A')
                else:
                    B = 0
                    C = 1
                    D.append('C')
            else:
                if s[i] == 'BC':
                    C = 0
                    B = 1
                    D.append('B')
                else:
                    C = 0
                    A = 1
                    D.append('A')
    print('Yes')
    print(*D,sep='\n')
    exit()

if (B == 0 and C == 0 and s[0] == 'BC') or (A == 0 and C == 0 and s[0] == 'AC') or (A == 0 and B == 0 and s[0] == 'AB'):
    print('No')
    exit()

print('Yes')

for i in range(N):
    if A+B+C > 2:
        if A == 0 and s[i] == 'AB':
            D.append('A')
            A = 1
            B -= 1
        elif A == 0 and s[i] == 'AC':
            D.append('A')
            A = 1
            C -= 1
        elif B == 0 and s[i] == 'AB':
            D.append('B')
            B = 1
            A -= 1
        elif B == 0 and s[i] == 'BC':
            D.append('B')
            B = 1
            C -= 1
        elif C == 0 and s[i] == 'AC':
            D.append('C')
            C = 1
            A -= 1
        elif C == 0 and s[i] == 'BC':
            D.append('C')
            C = 1
            B -= 1
        elif A == 0 and B == 1 and s[i] == 'BC':
            D.append('B')
            B += 1
            C -= 1
        elif A == 0 and C == 1 and s[i] == 'BC':
            D.append('C')
            C += 1
            B -= 1
        elif B == 0 and A == 1 and s[i] == 'AC':
            D.append('A')
            A += 1
            C -= 1
        elif B == 0 and C == 1 and s[i] == 'AC':
            D.append('C')
            C += 1
            A -= 1
        elif C == 0 and A == 1 and s[i] == 'AB':
            D.append('A')
            A += 1
            B -= 1
        elif C == 0 and B == 1 and s[i] == 'AB':
            D.append('B')
            B += 1
            A -= 1
        elif s[i] == 'AB':
            D.append('A')
            A += 1
            B -= 1
        elif s[i] == 'AC':
            D.append('A')
            A += 1
            C -= 1
        elif s[i] == 'BC':
            D.append('B')
            B += 1
            C -= 1
    else:  # A+B+C == 2 の場合
        if A == 1 and B == 1 and s[i] == 'AB':
            if i <= N-2 and s[i+1] == 'BC':
                D.append('B')
                A -= 1
                B += 1
            else:
                D.append('A')
                A += 1
                B -= 1
        elif A == 1 and C == 1 and s[i] == 'AC':
            if i <= N-2 and s[i+1] == 'AB':
                D.append('A')
                A += 1
                C -= 1
            else:
                D.append('C')
                A -= 1
                C += 1
        elif B == 1 and C == 1 and s[i] == 'BC':
            if i <= N-2 and s[i+1] == 'AB':
                D.append('B')
                B += 1
                C -= 1
            else:
                D.append('C')
                B -= 1
                C += 1
        elif A == 0 and s[i] == 'AB':
            D.append('A')
            A = 1
            B -= 1
        elif A == 0 and s[i] == 'AC':
            D.append('A')
            A = 1
            C -= 1
        elif B == 0 and s[i] == 'AB':
            D.append('B')
            B = 1
            A -= 1
        elif B == 0 and s[i] == 'BC':
            D.append('B')
            B = 1
            C -= 1
        elif C == 0 and s[i] == 'AC':
            D.append('C')
            C = 1
            A -= 1
        elif C == 0 and s[i] == 'BC':
            D.append('C')
            C = 1
            B -= 1
        elif s[i] == 'AB':
            D.append('A')
            A += 1
            B -= 1
        elif s[i] == 'AC':
            D.append('A')
            A += 1
            C -= 1
        elif s[i] == 'BC':
            D.append('B')
            B += 1
            C -= 1
print(*D,sep='\n')

Measured memory_bytes: 95108