N, A, B, C = map(int, input().split())
move = []
for i in range(N):
    new = input()
    move.append(new)
    
flag = 1
path = []
for i in range(N):
    if move[i] == "AB":
        if B==0:
            if A==0:
                flag=0
                break
            elif i < N-1:
                if move[i+1] == "AC" and A==1 and C==0:
                    flag=0
                    break
                else:
                    B += 1
                    A -= 1
                    path.append("B")
            else:
                B += 1
                A -= 1
                path.append("B")
        elif A==0:
            if B==0:
                flag=0
                break
            elif i < N-1:
                if move[i+1] == "BC" and B==1 and C==0:
                    flag=0
                    break
                else:
                    A += 1
                    B -= 1
                    path.append("A")
            else:
                A += 1
                B -= 1
                path.append("A")
        else:
            if i < N-1:
                if move[i+1] == "BC" and B==1 and C==0:
                    B += 1
                    A -= 1
                    path.append("B")
                else:
                    A += 1
                    B -= 1
                    path.append("A")
            else:
                A += 1
                B -= 1
                path.append("A")
    elif move[i] == "AC":
        if C==0:
            if A==0:
                flag=0
                break
            elif i < N-1:
                if move[i+1] == "AB" and A==1 and B==0:
                    flag=0
                    break
                else:
                    C += 1
                    A -= 1
                    path.append("C")
            else:
                C += 1
                A -= 1
                path.append("C")
        elif A==0:
            if C==0:
                flag=0
                break
            elif i < N-1:
                if move[i+1] == "BC" and B==0 and C==1:
                    flag=0
                    break
                else:
                    A += 1
                    C -= 1
                    path.append("A")
            else:
                A += 1
                C -= 1
                path.append("A")
        else:
            if i < N-1:
                if move[i+1] == "BC" and B==0 and C==1:
                    C += 1
                    A -= 1
                    path.append("C")
                else:
                    A += 1
                    C -= 1
                    path.append("A")
            else:
                A += 1
                C -= 1
                path.append("A")
    else:
        if B==0:
            if C==0:
                flag=0
                break
            elif i < N-1:
                if move[i+1] == "AC" and A==0 and C==1:
                    flag=0
                    break
                else:
                    B += 1
                    C -= 1
                    path.append("B")
            else:
                B += 1
                C -= 1
                path.append("B")
        elif C==0:
            if B==0:
                flag=0
                break
            elif i < N-1:
                if move[i+1] == "AB" and B==1 and A==0:
                    flag=0
                    break
                else:
                    C += 1
                    B -= 1
                    path.append("C")
            else:
                C += 1
                B -= 1
                path.append("C")
        else:
            if i < N-1:
                if move[i+1] == "AB" and A==0 and B==1:
                    B += 1
                    C -= 1
                    path.append("B")
                else:
                    C += 1
                    B -= 1
                    path.append("C")
            else:
                C += 1
                B -= 1
                path.append("C")  
    if flag==0:
        break
    #print(A,B,C)
                
if flag == 0:
    print("No")
else:
    print("Yes")
    for p in path:
        print(p)

Measured memory_bytes: 16948