#include<stdio.h>
#define ll long long
int search(char a[]){
    if(a[0] == 'A' && a[1] == 'B')
        return 1;
    if(a[0] == 'A' && a[1] == 'C')
        return 2;
    return 3;
}
ll min(ll a, ll b){return a < b ? a : b;}
int main(){
    int n;
    ll a, b, c;
    scanf("%d%lld%lld%lld",&n,&a,&b,&c);
    char s[n + 1];
    int index = 0;
    for(int i = 0; i < n; i++){
        char t[3];
        scanf("%s",t);
        int p = search(t);
        if(p == 1){
            if(a > b){
                a--;
                b++;
                s[index] = 'B';
                index++;
            }
            else{
                a++;
                b--;
                s[index] = 'A';
                index++;
            }
        }
        else if(p == 2){
            if(a > c){
                a--;
                c++;
                s[index] = 'C';
                index++;
            }
            else{
                a++;
                c--;
                s[index] = 'A';
                index++;
            }
        }
        else{
            if(b > c){
                b++;
                c--;
                s[index] = 'B';
                index++;
            }
            else{
                b--;
                c++;
                s[index] = 'C';
                index++;
            }
        }
    }
    ll w = min(a,min(b,c));
    if(w < 0){
        puts("No");
    }
    else{
        puts("Yes");
        for(int i = 0; i < n; i++)
            printf("%c\n",s[i]);
    }
    return 0;
}