import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n, a, b, c = map(int, readline().split())

    s = [input() for _ in range(n)]
    m = []

    if a == b == c == 0:
        return print("No")
    else:
        for i in range(n):
            cur = s[i]
            if cur == "AB":
                if a == b == 0:
                    return print("No")
                elif a == 0:
                    m.append("A")
                    a += 1
                    b -= 1
                elif b == 0:
                    m.append("B")
                    b += 1
                    a -= 1
                else:
                    if i < n - 1:
                        if s[i + 1] == "AB":
                            m.append("A")
                            a += 1
                            b -= 1
                        elif s[i + 1] == "BC":
                            m.append("B")
                            b += 1
                            a -= 1
                        else:
                            m.append("A")
                            a += 1
                            b -= 1
                    else:
                        m.append("A")
                        a += 1
                        b -= 1
            if cur == "BC":
                if b == c == 0:
                    return print("No")
                elif b == 0:
                    m.append("B")
                    b += 1
                    c -= 1
                elif c == 0:
                    m.append("C")
                    c += 1
                    b -= 1
                else:
                    if i < n - 1:
                        if s[i + 1] == "BC":
                            m.append("B")
                            b += 1
                            c -= 1
                        elif s[i + 1] == "AC":
                            m.append("C")
                            c += 1
                            b -= 1
                        else:
                            m.append("B")
                            b += 1
                            c -= 1
                    else:
                        m.append("B")
                        b += 1
                        c -= 1
            if cur == "AC":
                if a == c == 0:
                    return print("No")
                elif a == 0:
                    m.append("A")
                    a += 1
                    c -= 1
                elif c == 0:
                    m.append("C")
                    c += 1
                    a -= 1
                else:
                    if i < n - 1:
                        if s[i + 1] == "AC":
                            m.append("A")
                            a += 1
                            c -= 1
                        elif s[i + 1] == "BC":
                            m.append("C")
                            c += 1
                            a -= 1
                        else:
                            m.append("A")
                            a += 1
                            c -= 1
                    else:
                        m.append("A")
                        a += 1
                        c -= 1

        print("Yes")
        for x in m:
            print(x)

if __name__ == '__main__':
    main()


Measured memory_bytes: 85788