'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7
dir = [(-1,0),(0,-1),(1,0),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"

def main():
    n,a,b,c = map(int,ipt().split())
    s = a+b+c
    q = [input() for i in range(n)]
    ans = []

    for i,qi in enumerate(q):
        if qi == "AB":
            if a == b == 0:
                print("No")
                exit()
            elif a == 0:
                ans.append("A")
                a += 1
                b -= 1
            elif b == 0:
                ans.append("B")
                a -= 1
                b += 1
            elif i == n-1:
                ans.append("A")
            elif a == b == 1:
                if q[i+1] == "BC":
                    ans.append("B")
                    b += 1
                    a -= 1
                else:
                    ans.append("A")
                    b -= 1
                    a += 1
            else:
                if a > b:
                    ans.append("B")
                    b += 1
                    a -= 1
                else:
                    ans.append("A")
                    a += 1
                    b -= 1
        elif qi == "BC":
            if c == b == 0:
                print("No")
                exit()
            elif c == 0:
                ans.append("C")
                c += 1
                b -= 1
            elif b == 0:
                ans.append("B")
                c -= 1
                b += 1
            elif i == n-1:
                ans.append("C")
            elif c == b == 1:
                if q[i+1] == "AB":
                    ans.append("B")
                    b += 1
                    c -= 1
                else:
                    ans.append("C")
                    b -= 1
                    c += 1
            else:
                if c > b:
                    ans.append("B")
                    b += 1
                    c -= 1
                else:
                    ans.append("C")
                    c += 1
                    b -= 1
        else:
            if a == c == 0:
                print("No")
                exit()
            elif a == 0:
                ans.append("A")
                a += 1
                c -= 1
            elif c == 0:
                ans.append("C")
                a -= 1
                c += 1
            elif i == n-1:
                ans.append("A")
            elif a == c == 1:
                if q[i+1] == "BC":
                    ans.append("C")
                    c += 1
                    a -= 1
                else:
                    ans.append("A")
                    c -= 1
                    a += 1
            else:
                if a > c:
                    ans.append("C")
                    c += 1
                    a -= 1
                else:
                    ans.append("A")
                    a += 1
                    c -= 1

    print("Yes")
    for i in ans:
        print(i)
    return None

if __name__ == '__main__':
    main()


Measured memory_bytes: 92896