There is a game that involves three variables, denoted A, B, and C.  As the game progresses, there will be N events where you are asked to make a choice. Each of these choices is represented by a string s_i. If s_i is `AB`, you must add 1 to A or B then subtract 1 from the other; if s_i is `AC`, you must add 1 to A or C then subtract 1 from the other; if s_i is `BC`, you must add 1 to B or C then subtract 1 from the other.  After each choice, none of A, B, and C should be negative.  Determine whether it is possible to make N choices under this condition. If it is possible, also give one such way to make the choices.


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def _solve(A, B, C, S):
    counter = {'A': A, 'B': B, 'C': C}
    last = S[0][0]
    answer = []
    for s in S:
        if s[0] == last:
            counter[s[0]] -= 1
            counter[s[1]] += 1
            if counter[s[0]] < 0:
                return None
            answer.append(s[1])
        else:
            counter[s[1]] -= 1
            counter[s[0]] += 1
            if counter[s[1]] < 0:
                return None
            answer.append(s[0])
        last = s[1]
    return answer



def solve():
    N, A, B, C = read_ints()
    S = []
    for _ in range(N):
        S.append(input().strip())
    answer = _solve(A, B, C, S)
    if answer is None:
        S[0] = S[0][1]+S[0][0]
        answer = _solve(A, B, C, S)
        if answer is None:
            print('No')
            return
    for a in answer:
        print(a)


if __name__ == '__main__':
    solve()



def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))

def third(x, y):
    return (set('ABC')-set([x,y])).pop()

def other(S, c):
    if S[0] == c:
        return S[1]
    return S[0]

def _solve(A, B, C, S):
    counter = {'A': A, 'B': B, 'C': C}
    answer = []
    i = 0
    while i < len(S):
        s = S[i]
        if counter[s[0]] > 0:
            counter[s[0]] -= 1
            counter[s[1]] += 1
            answer.append(s[1])
        elif counter[s[1]] > 0:
            counter[s[0]] += 1
            counter[s[1]] -= 1
            answer.append(s[0])
        else:
            if i == 0:
                return None
            if S[i-1][0] in s:
                prev_dest = S[i-1][1]
                prev_src = S[i-1][0]
            else:
                prev_dest = S[i-1][0]
                prev_src = S[i-1][1]
            answer.pop()
            answer.append(prev_src)
            counter[prev_dest] -= 2
            counter[prev_src] += 2
            if counter[prev_dest] < 0:
                return None
            i -= 1
        i += 1
    return answer



def solve():
    N, A, B, C = read_ints()
    S = []
    for _ in range(N):
        S.append(input().strip())
    answer = _solve(A, B, C, S)
    if answer is None:
        print('No')
        return
    print('Yes')
    for a in answer:
        print(a)


if __name__ == '__main__':
    solve()
