def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math

    #inf = 10**17
    #mod = 10**9 + 7

    n,a,b,c = map(int, input().split())
    s = [input().rstrip() for _ in range(n)]
    res = []
    for i in range(n-1):
        if s[i]=='AB':
            if s[i+1]=='AB':
                if a>=b:
                    a -= 1
                    b += 1
                    res.append('B')
                else:
                    a += 1
                    b -= 1
                    res.append('A')
            elif s[i+1]=='BC':
                if a>=b:
                    a -= 1
                    b += 1
                    res.append('B')
                else:
                    a += 1
                    b -= 1
                    res.append('A')
            else:
                if a>b:
                    a -= 1
                    b += 1
                    res.append('B')
                else:
                    a += 1
                    b -= 1
                    res.append('A')
        if s[i]=='BC':
            if s[i+1]=='BC':
                if b>=c:
                    b -= 1
                    c += 1
                    res.append('C')
                else:
                    b += 1
                    c -= 1
                    res.append('B')
            elif s[i+1]=='AC':
                if b>=c:
                    b -= 1
                    c += 1
                    res.append('C')
                else:
                    b += 1
                    c -= 1
                    res.append('B')
            else:
                if b>c:
                    b -= 1
                    c += 1
                    res.append('C')
                else:
                    b += 1
                    c -= 1
                    res.append('B')
        if s[i]=='AC':
            if s[i+1]=='AC':
                if a>=c:
                    a -= 1
                    c += 1
                    res.append('C')
                else:
                    a += 1
                    c -= 1
                    res.append('A')
            elif s[i+1]=='BC':
                if a>=c:
                    a -= 1
                    c += 1
                    res.append('C')
                else:
                    a += 1
                    c -= 1
                    res.append('A')
            else:
                if a>c:
                    a -= 1
                    c += 1
                    res.append('C')
                else:
                    a += 1
                    c -= 1
                    res.append('A')
        if a<0 or b<0 or c<0:
            print('No')
            break
    else:
        if s[-1]=='AB':
            if a>=b:
                a -= 1
                b += 1
                res.append('B')
            else:
                a += 1
                b -= 1
                res.append('A')
        if s[-1]=='AC':
            if a>=c:
                a -= 1
                c += 1
                res.append('C')
            else:
                a += 1
                c -= 1
                res.append('A')
        if s[-1]=='BC':
            if c>=b:
                c -= 1
                b += 1
                res.append('B')
            else:
                c += 1
                b -= 1
                res.append('C')
        if a>=0 and b>=0 and c>=0:
            print('Yes')
            for i in res:
                print(i)
        else:
            print('No')

if __name__ == '__main__':
    main()

Measured memory_bytes: 17444