from collections import deque
from itertools import product
import sys
import math
import numpy as np
import bisect

sys.setrecursionlimit(200000)
input = sys.stdin.readline


def read():
    N, A, B, C = map(int, input().strip().split())
    S = []
    for i in range(N):
        s = input().strip()
        S.append(s)
    return N, A, B, C, S


def choose_at_corner_state(A, B, C, s):
    """次の一手を返す"""
    if A == 0 and C == 0:
        if s == "BC" and not is_error_state(A, B-1, C+1):
            return ("C", A, B-1, C+1)
        if s == "AB" and not is_error_state(A+1, B-1, C):
            return ("A", A+1, B-1, C)
    elif A == 0 and B == 0:
        if s == "AC" and not is_error_state(A+1, B, C-1):
            return ("A", A+1, B, C-1)
        if s == "BC" and not is_error_state(A, B+1, C-1):
            return ("B", A, B+1, C-1)
    elif B == 0 and C == 0:
        if s == "AC" and not is_error_state(A-1, B, C+1):
            return ("C", A-1, B, C+1)
        if s == "AB" and not is_error_state(A-1, B+1, C):
            return ("B", A-1, B+1, C)
    return ("X", -1, -1, -1)


def is_error_state(A, B, C):
    if A < 0 or B < 0 or C < 0:
        return True
    return False


def is_corner_state(A, B, C):
    if A == 0 and B == 0:
        return True
    elif A == 0 and C == 0:
        return True
    elif B == 0 and C == 0:
        return True
    return False


def choose_at_normal_state(A, B, C, s0, s1):
    """先読みして、次の一手を返す"""
    if s0 == "BC":
        op0, a0, b0, c0 = ("C", A, B-1, C+1)
        if is_error_state(a0, b0, c0):
            pass
        elif is_corner_state(a0, b0, c0):
            op1, a1, b1, c1 = choose_at_corner_state(a0, b0, c0, s1)
            if op1 != "X":
                return (op0, a0, b0, c0)
        else:
            return (op0, a0, b0, c0)
        op0, a0, b0, c0 = ("B", A, B+1, C-1)
        if is_error_state(a0, b0, c0):
            pass
        elif is_corner_state(a0, b0, c0):
            op1, a1, b1, c1 = choose_at_corner_state(a0, b0, c0, s1)
            if op1 != "X":
                return (op0, a0, b0, c0)
        else:
            return (op0, a0, b0, c0)
    elif s0 == "AC":
        op0, a0, b0, c0 = ("C", A-1, B, C+1)
        if is_error_state(a0, b0, c0):
            pass
        elif is_corner_state(a0, b0, c0):
            op1, a1, b1, c1 = choose_at_corner_state(a0, b0, c0, s1)
            if op1 != "X":
                return (op0, a0, b0, c0)
        else:
            return (op0, a0, b0, c0)
        op0, a0, b0, c0 = ("A", A+1, B, C-1)
        if is_error_state(a0, b0, c0):
            pass
        elif is_corner_state(a0, b0, c0):
            op1, a1, b1, c1 = choose_at_corner_state(a0, b0, c0, s1)
            if op1 != "X":
                return (op0, a0, b0, c0)
        else:
            return (op0, a0, b0, c0)
    elif s0 == "AB":
        op0, a0, b0, c0 = ("B", A-1, B+1, C)
        if is_error_state(a0, b0, c0):
            pass
        elif is_corner_state(a0, b0, c0):
            op1, a1, b1, c1 = choose_at_corner_state(a0, b0, c0, s1)
            if op1 != "X":
                return (op0, a0, b0, c0)
        else:
            return (op0, a0, b0, c0)
        op0, a0, b0, c0 = ("A", A+1, B-1, C)
        if is_error_state(a0, b0, c0):
            pass
        elif is_corner_state(a0, b0, c0):
            op1, a1, b1, c1 = choose_at_corner_state(a0, b0, c0, s1)
            if op1 != "X":
                return (op0, a0, b0, c0)
        else:
            return (op0, a0, b0, c0)
    return ("X", -1, -1, -1)


def trial(N, A, B, C, S):
    
    if A + B + C == 0:
        return False, []
    
    ans, choices = True, []

    S = S + [S[-1]]  # S[-1] is terminal state

    if A + B + C == 1:
        for i in range(N):
            x, A, B, C = choose_at_corner_state(A, B, C, S[i])
            if x == "X":
                return False, []
            else:
                choices.append(x)
    else:
        for i in range(N):
            if is_corner_state(A, B, C):
                x, A, B, C = choose_at_corner_state(A, B, C, S[i])
            else:
                x, A, B, C = choose_at_normal_state(A, B, C, S[i], S[i+1])
            if x == "X":
                return False, []
            else:
                choices.append(x)
    return ans, choices


def solve(N, A, B, C, S):
    ans, choices = trial(N, A, B, C, S)
    if ans:
        print("Yes")
        for c in choices:
            print(c)
    else:
        print("No")


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("{}".format(outputs))

Measured memory_bytes: 35760