import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    n,a,b,c = inpm()
    S = []
    ans = []
    for i in range(n):
        s = input()
        S.append(s)
    for i in range(n):
        s = S[i]
        if s == 'AB':
            if a == 0 and b == 0:
                print('No')
                return
            if a == 0:
                a += 1
                b -= 1
                ans.append('A')
            elif b == 0:
                a -= 1
                b += 1
                ans.append('B')
            elif a == 1 and b == 1 and i < n-1 and s != S[i+1]:
                if S[i+1] == 'AC':
                    a += 1
                    b -= 1
                    ans.append('A')
                else:
                    b += 1
                    a -= 1
                    ans.append('B')
            else:
                if a > b:
                    a -= 1
                    b += 1
                    ans.append('B')
                else:
                    a += 1
                    b -= 1
                    ans.append('A')
        if s == 'AC':
            if a == 0 and c == 0:
                print('No')
                return
            if a == 0:
                a += 1
                c -= 1
                ans.append('A')
            elif c == 0:
                a -= 1
                c += 1
                ans.append('C')
            elif a == 1 and c == 1 and i < n-1 and s != S[i+1]:
                if S[i+1] == 'AB':
                    a += 1
                    c -= 1
                    ans.append('A')
                else:
                    c += 1
                    a -= 1
                    ans.append('C')
            else:
                if a > c:
                    a -= 1
                    c += 1
                    ans.append('C')
                else:
                    a += 1
                    c -= 1
                    ans.append('A')
        if s == 'BC':
            if c == 0 and b == 0:
                print('No')
                return
            if b == 0:
                b += 1
                c -= 1
                ans.append('B')
            elif c == 0:
                b -= 1
                c += 1
                ans.append('C')
            elif b == 1 and c == 1 and i < n-1 and s != S[i+1]:
                if S[i+1] == 'AB':
                    b += 1
                    c -= 1
                    ans.append('B')
                else:
                    c += 1
                    b -= 1
                    ans.append('C')
            else:
                if b > c:
                    b -= 1
                    c += 1
                    ans.append('C')
                else:
                    b += 1
                    c -= 1
                    ans.append('B')
    print('Yes')
    for i in range(n):
        print(ans[i])

if __name__ == "__main__":
    main()

Measured memory_bytes: 18640