def main():
    n, a, b, c = map(int, input().split())
    s_list = [input() for _ in [0]*n]

    if a == b == c == 0:
        print("No")
    elif a+b+c == 1:
        if a == 1:
            color = "A"
        elif b == 1:
            color = "B"
        else:
            color = "C"
        l = []
        for i in s_list:
            if color not in i:
                print("No")
                return
            j = list(i)
            j.remove(color)
            color = j[0]
            l.append(color)
        print("Yes")
        for i in l:
            print(i)
    else:
        s_list += ["ABC"]
        l = []
        for j, i in enumerate(s_list[:-1]):
            if i == "AB":
                if a >= 2:
                    l.append("B")
                    a -= 1
                    b += 1
                elif b >= 2:
                    l.append("A")
                    a += 1
                    b -= 1
                elif a == b == 0:
                    print("No")
                    return
                elif a == 1 and b == 0:
                    l.append("B")
                    a -= 1
                    b += 1
                elif a == 0 and b == 1:
                    l.append("A")
                    a += 1
                    b -= 1
                else:
                    if "A" in s_list[j+1]:
                        l.append("A")
                        a += 1
                        b -= 1
                    else:
                        l.append("B")
                        a -= 1
                        b += 1
            elif i == "BC":
                if b >= 2:
                    l.append("C")
                    b -= 1
                    c += 1
                elif c >= 2:
                    l.append("B")
                    b += 1
                    c -= 1
                elif b == c == 0:
                    print("No")
                    return
                elif b == 1 and c == 0:
                    l.append("C")
                    b -= 1
                    c += 1
                elif b == 0 and c == 1:
                    l.append("B")
                    b += 1
                    c -= 1
                else:
                    if "B" in s_list[j+1]:
                        l.append("B")
                        b += 1
                        c -= 1
                    else:
                        l.append("C")
                        b -= 1
                        c += 1
            else:
                if c >= 2:
                    l.append("A")
                    c -= 1
                    a += 1
                elif a >= 2:
                    l.append("C")
                    c += 1
                    a -= 1
                elif c == a == 0:
                    print("No")
                    return
                elif c == 1 and a == 0:
                    l.append("A")
                    c -= 1
                    a += 1
                elif c == 0 and a == 1:
                    l.append("C")
                    c += 1
                    a -= 1
                else:
                    if "C" in s_list[j+1]:
                        l.append("C")
                        c += 1
                        a -= 1
                    else:
                        l.append("A")
                        c -= 1
                        a += 1
        print("Yes")
        for i in l:
            print(i)


main()


Measured memory_bytes: 17760