n,a,b,c = map(int,input().split())
flag = True
ans = []
s = []
for i in range(n):
    s.append(input())
for i in range(n):
    if s[i] == "AB":
        if a == 0 and b == 0:
            flag = False
        if a > b:
            a -= 1
            b += 1
            ans.append("B")
        if b < a:
            a += 1
            b -= 1
            ans.append("A")
        if a == b:
            if s[i+1] == "AC":
                a += 1
                b -= 1
                ans.append("A")
            else:
                a -= 1
                b += 1
                ans.append("B")
    if s[i] == "BC":
        if b == 0 and c == 0:
            flag = False
        if b > c:
            b -= 1
            c += 1
            ans.append("C")
        if b < c:
            b += 1
            c -= 1
            ans.append("B")
        if b == c:
            if s[i+1] == "AB":
                b += 1
                c -= 1
                ans.append("B")
            else:
                c += 1
                b -= 1
                ans.append("B")
    if s[i] == "AC":
        if a == 0 and c == 0:
            flag = False
        if a > c:
            a -= 1
            c += 1
            ans.append("C")
        if c > a:
            a += 1
            c -= 1
            ans.append("A")
        if c == a:
            if s[i+1] == "AB"
                a += 1
                c -= 1
                ans.append("A")
            else:
                c += 1
                a -= 1
                ans.append("C")
if flag:
    print("Yes")
    for i in ans:
        print(i)
else:
    print("No")

### FIXED CODE ###

n,A,B,C = map(int,input().split())
flag = True
ans = []
s = []
for i in range(n):
    s.append(input())
s.append("")
for i in range(n):
    if s[i] == "AB":
        if A == 0 and B == 0:
            flag = False
        elif A == 1 and B == 1:
            if s[i+1] == "BC":
                A -= 1
                B += 1
                ans.append("B")
            else:
                B -= 1
                A += 1
                ans.append("A")
        elif A >= B:
            A -= 1
            B += 1
            ans.append("B")
        else:
            B -= 1
            A += 1
            ans.append("A")
    if s[i] == "AC":
        if A == 0 and C == 0:
            flag = False
        elif A == 1 and C == 1:
            if s[i+1] == "BC":
                A -= 1
                C += 1
                ans.append("C")
            else:
                C -= 1
                A += 1
                ans.append("A")
        elif A >= C:
            A -= 1
            C += 1
            ans.append("C")
        else:
            C -= 1
            A += 1
            ans.append("A")
    if s[i] == "BC":
        if B == 0 and C == 0:
            flag = False
        elif B == 1 and C == 1:
            if s[i+1] == "AC":
                B -= 1
                C += 1
                ans.append("C")
            else:
                C -= 1
                B += 1
                ans.append("B")
        elif B >= C:
            B -= 1
            C += 1
            ans.append("C")
        else:
            C -= 1
            B += 1
            ans.append("B")
if flag:
    print("Yes")
    for i in ans:
        print(i)
else:
    print("No")