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


### FIXED CODE ###

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