n, a, b, c = map(int, input().split())

q = [(0, 1) if si == 'AB' else (1, 2) if si == 'BC' else (0, 2) for si in (input() for _ in range(n))]

ans = []

ch = ['A', 'B', 'C']

d = [a, b, c]



nxt = [[-1] * 3] * n

t = [-1, -1, -1]

for i, (x, y) in reversed(list(enumerate(q))):

    nxt[i] = t.copy()

    t[x], t[y] = y, x

for (x, y), t in zip(q, nxt):

    if d[x] == d[y] == 0:

        print('No')

        break

    if d[x] != 0 and (d[y] == 0 or d[x] >= 2 or t[3 - x - y] == y):

            x, y = y, x

    d[x] += 1

    d[y] -= 1

    ans.append(ch[x])

else:

    print('Yes', *ans, sep='\n')

n, a, b, c = map(int, input().split())

q = [(0, 1) if s == 'AB' else (1, 2) if s == 'BC' else (0, 2) for s in (input() for _ in range(n))]

ans = []

ch = ('A', 'B', 'C')

d = [a, b, c]



for (x, y), t in zip(q, q[1:] + [()]):

    if d[x] + d[y] == 0:

        print('No')

        break

    if d[x] > d[y] or d[x] * d[y] == 1 and y in t:

        x, y = y, x

    d[x] += 1

    d[y] -= 1

    ans.append(ch[x])

else:

    print('Yes', *ans, sep='\n')

n, a, b, c = map(int, input().split())
q = [
    (0, 1) if si == "AB" else (1, 2) if si == "BC" else (0, 2)
    for si in (input() for _ in range(n))
]
ans = []
ch = ["A", "B", "C"]
d = [a, b, c]
nxt = [[-1] * 3] * n
t = [-1, -1, -1]
for i, (x, y) in reversed(list(enumerate(q))):
    nxt[i] = t.copy()
    t[x], t[y] = y, x
for (x, y), t in zip(q, nxt):
    if d[x] == d[y] == 0:
        print("No")
        break
    if d[x] != 0 and (d[y] == 0 or d[x] >= 2 or t[3 - x - y] == y):
        x, y = y, x
    d[x] += 1
    d[y] -= 1
    ans.append(ch[x])
else:
    print("Yes", *ans, sep="\n")

n, a, b, c = map(int, input().split())
q = [
    (0, 1) if s == "AB" else (1, 2) if s == "BC" else (0, 2)
    for s in (input() for _ in range(n))
]
ans = []
ch = ("A", "B", "C")
d = [a, b, c]
for (x, y), t in zip(q, q[1:] + [()]):
    if d[x] + d[y] == 0:
        print("No")
        break
    if d[x] > d[y] or d[x] * d[y] == 1 and y in t:
        x, y = y, x
    d[x] += 1
    d[y] -= 1
    ans.append(ch[x])
else:
    print("Yes", *ans, sep="\n")

-    (0, 1) if si == "AB" else (1, 2) if si == "BC" else (0, 2) -    for si in (input() for _ in range(n)) +    (0, 1) if s == "AB" else (1, 2) if s == "BC" else (0, 2) +    for s in (input() for _ in range(n)) -ch = ["A", "B", "C"] +ch = ("A", "B", "C") -nxt = [[-1] * 3] * n -t = [-1, -1, -1] -for i, (x, y) in reversed(list(enumerate(q))): -    nxt[i] = t.copy() -    t[x], t[y] = y, x -for (x, y), t in zip(q, nxt): -    if d[x] == d[y] == 0: +for (x, y), t in zip(q, q[1:] + [()]): +    if d[x] + d[y] == 0: -    if d[x] != 0 and (d[y] == 0 or d[x] >= 2 or t[3 - x - y] == y): +    if d[x] > d[y] or d[x] * d[y] == 1 and y in t: