ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


n,a,b,c = mi()
s = []
for i in range(n):
    s.append(input())
z = a+ b+ c
flag = True
ans = []
if z != 2:
    for i in range(n):
        if s[i] == "AB":
            if a == 0 and b == 0:
                print("No")
                exit()
            if a > b:
                a -= 1
                b += 1
                ans.append("B")
            else:
                a += 1
                b -= 1
                ans.append("A")

        if s[i] == "BC":
            if c == 0 and b == 0:
                print("No")
                exit()
            if c > b:
                c -= 1
                b += 1
                ans.append("B")
            else:
                c += 1
                b -= 1
                ans.append("C")
        if s[i] == "AC":
            if c == 0 and a == 0:
                print("No")
                exit()
            if c > a:
                c -= 1
                a += 1
                ans.append("A")
            else:
                c += 1
                a -= 1
                ans.append("C")
    print("Yes")
    for l in range(n):
        print(ans[l])

else:
    for i in range(n):
        if s[i] == "AB":
            if a == 0 and b == 0:
                print("No")
                exit()
            if a > b:
                a -= 1
                b += 1
                ans.append("B")
            elif a == b:
                if i == n-1:
                    ans.append("B")
                elif s[i+1] == "BC":
                    a -= 1
                    b += 1
                    ans.append("B")
                else:
                    a += 1
                    b -= 1
                    ans.append("A")
            else:
                a += 1
                b -= 1
                ans.append("A")

        if s[i] == "BC":
            if c == 0 and b == 0:
                print("No")
                exit()
            if c > b:
                c -= 1
                b += 1
                ans.append("B")
            elif c == b:
                if i == n-1:
                    ans.append("B")
                elif s[i+1] == "AB":
                    c -= 1
                    b += 1
                    ans.append("B")
                else:
                    c += 1
                    b -= 1
                    ans.append("C")
            else:
                c += 1
                b -= 1
                ans.append("C")
        if s[i] == "AC":
            if c == 0 and a == 0:
                print("No")
                exit()
            if c > a:
                c -= 1
                a += 1
                ans.append("A")
            elif c == a:
                if i == (n-1):
                    ans.append("A")
                elif s[i+1] == "AB":
                    c -= 1
                    a += 1
                    ans.append("A")
                else:
                    c += 1
                    a -= 1
                    ans.append("C")
            else:
                c += 1
                a -= 1
                ans.append("C")
    print("Yes")
    for l in range(n):
        print(ans[l])




Measured memory_bytes: 16948