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

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

#########################

elif A + B + C == 1:
    ans = []
    for i in range(N):
        # (1,0,0)
        if A == 1:
            if S[i] == "BC":
                print("No")
                exit()
            elif S[i] == "AB":
                ans.append("B")
                A, B, C = 0, 1, 0
            elif S[i] == "AC":
                ans.append("C")
                A, B, C = 0, 0, 1
        # (0,1,0)
        elif B == 1:
            if S[i] == "AC":
                print("No")
                exit()
            elif S[i] == "AB":
                ans.append("A")
                A, B, C = 1, 0, 0
            elif S[i] == "BC":
                ans.append("C")
                A, B, C = 0, 0, 1
        # (0,0,1)
        elif C == 1:
            if S[i] == "AB":
                print("No")
                exit()
            elif S[i] == "BC":
                ans.append("B")
                A, B, C = 0, 1, 0
            elif S[i] == "AC":
                ans.append("A")
                A, B, C = 1, 0, 0

    print("Yes")
    for i in range(N):
        print(ans[i])

#########################

elif A + B + C >= 2:
    if S[0] == "AB" and A == B == 0:
        print("No")
    elif S[0] == "BC" and B == C == 0:
        print("No")
    elif S[0] == "AC" and A == C == 0:
        print("No")
    else:
        ans = []
        #########################
        if A + B + C >= 3:
            for i in range(N):
                if S[i] == "AB":
                    if A >= B:
                        A -= 1
                        B += 1
                        ans.append("B")
                    else:
                        A += 1
                        B -= 1
                        ans.append("A")
                elif S[i] == "AC":
                    if A >= C:
                        A -= 1
                        C += 1
                        ans.append("C")
                    else:
                        A += 1
                        C -= 1
                        ans.append("A")
                elif S[i] == "BC":
                    if B >= C:
                        B -= 1
                        C += 1
                        ans.append("C")
                    else:
                        B += 1
                        C -= 1
                        ans.append("B")
        #########################
        elif A + B + C == 2:
            for i in range(N):
                if A == B == 1 and S[i] == "AB" and i < N - 1 and S[i] != S[i + 1]:
                    if S[i + 1] == "AC":
                        ans.append("A")
                        A += 1
                        B -= 1
                    elif S[i + 1] == "BC":
                        ans.append("B")
                        A -= 1
                        B += 1
                elif A == C == 1 and S[i] == "AC" and i < N - 1 and S[i] != S[i + 1]:
                    if S[i + 1] == "AB":
                        ans.append("A")
                        A += 1
                        C -= 1
                    elif S[i + 1] == "BC":
                        ans.append("C")
                        A -= 1
                        C += 1
                elif B == C == 1 and S[i] == "BC" and i < N - 1 and S[i] != S[i + 1]:
                    if S[i + 1] == "AB":
                        ans.append("B")
                        B += 1
                        C -= 1
                    elif S[i + 1] == "AC":
                        ans.append("C")
                        B -= 1
                        C += 1
                else:
                    if S[i] == "AB":
                        if A >= B:
                            A -= 1
                            B += 1
                            ans.append("B")
                        else:
                            A += 1
                            B -= 1
                            ans.append("A")
                    elif S[i] == "AC":
                        if A >= C:
                            A -= 1
                            C += 1
                            ans.append("C")
                        else:
                            A += 1
                            C -= 1
                            ans.append("A")
                    else:
                        if B >= C:
                            B -= 1
                            C += 1
                            ans.append("C")
                        else:
                            B += 1
                            C -= 1
                            ans.append("B")
        print("Yes")
        for i in range(N):
            print(ans[i])


Measured memory_bytes: 89072