def solve(n, a, b, c, s_ls):
    ans = []
    for i in range(n):
        s = s_ls[i]
        if s == "AB":
            if a == 0 and b == 0:
                return False, []
            elif a == 0:
                ans.append("A")
                a += 1
                b -= 1
            elif b == 0:
                ans.append("B")
                a -= 1
                b += 1
            elif a == b == 1 and c == 0:
                if i == n - 1:
                    ans.append("A")
                    a += 1
                    b -= 1
                else:
                    nex = s_ls[i + 1]
                    if nex == "BC":
                        ans.append("B")
                        a -= 1
                        b += 1
                    else:
                        ans.append("A")
                        a += 1
                        b -= 1
            else:
                if a >= b:
                    ans.append("B")
                    a -= 1
                    b += 1
                else:
                    ans.append("A")
                    a += 1
                    b -= 1
        elif s == "BC":
            if b == 0 and c == 0:
                return False, []
            elif c == 0:
                ans.append("C")
                b -= 1
                c += 1
            elif b == 0:
                ans.append("B")
                b += 1
                c -= 1
            elif c == b == 1 and a == 0:
                if i == n - 1:
                    ans.append("C")
                    b -= 1
                    c += 1
                else:
                    nex = s_ls[i + 1]
                    if nex == "AB":
                        ans.append("B")
                        b += 1
                        c -= 1
                    else:
                        ans.append("C")
                        b -= 1
                        c += 1
            else:
                if c >= b:
                    ans.append("B")
                    b += 1
                    c -= 1
                else:
                    ans.append("C")
                    b -= 1
                    c += 1
        elif s == "AC":
            if a == 0 and c == 0:
                return False, []
            elif a == 0:
                ans.append("A")
                a += 1
                c -= 1
            elif c == 0:
                ans.append("C")
                a -= 1
                c += 1
            elif a == c == 1 and b == 0:
                if i == n - 1:
                    ans.append("A")
                    a += 1
                    c -= 1
                else:
                    nex = s_ls[i + 1]
                    if nex == "AB":
                        ans.append("A")
                        a += 1
                        c -= 1
                    else:
                        ans.append("C")
                        a -= 1
                        c += 1
            else:
                if a >= c:
                    ans.append("C")
                    a -= 1
                    c += 1
                else:
                    ans.append("A")
                    a += 1
                    c -= 1
    return True, ans


def main():
    n, a, b, c = map(int, input().split())
    s_ls = []
    for i in range(n):
        s_ls.append(input())

    res, ans = solve(n, a, b, c, s_ls)
    if not res:
        print("No")
    else:
        print("Yes")
        for x in ans:
            print(x)


main()


Measured memory_bytes: 17004