#include <iostream>
#include <string>
#include <vector>
using ll=long long;
using namespace std;

int main(){
    int N,A,B,C;
    cin>>N>>A>>B>>C;
    vector<string> S(N);
    for(int i=0;i<N;i++){
        cin>>S[i];
    }

    int ans=1;
    vector<char> action;
    for(int i=0;i<N-1;i++){
        if(S[i]=="AB"){
            if(A==0){
                A++;
                B--;
                action.push_back('A');
            }else if(B==0){
                A--;
                B++;
                action.push_back('B');
            }else{
                if(A==1 && (S[i+1]=="AB" || S[i+1]=="AC")){
                    A++;
                    B--;
                    action.push_back('A');
                }else if(B==1 && (S[i+1]=="AB" || S[i+1]=="BC")){
                    B++;
                    A--;
                    action.push_back('B');
                }else{
                    A++;
                    B--;
                    action.push_back('A');
                }
            }
        }else if(S[i]=="BC"){
            if(C==0){
                C++;
                B--;
                action.push_back('C');
            }else if(B==0){
                C--;
                B++;
                action.push_back('B');
            }else{
                if(C==1 && (S[i+1]=="AC" || S[i+1]=="BC")){
                    C++;
                    B--;
                    action.push_back('C');
                }else if(B==1 && (S[i+1]=="AB" || S[i+1]=="BC")){
                    B++;
                    C--;
                    action.push_back('B');
                }else{
                    C++;
                    B--;
                    action.push_back('C');
                }
            }

        }else{
            if(A==0){
                A++;
                C--;
                action.push_back('A');
            }else if(C==0){
                A--;
                C++;
                action.push_back('C');
            }else{
                if(A==1 && (S[i+1]=="AB" || S[i+1]=="AC")){
                    A++;
                    C--;
                    action.push_back('A');
                }else if(C==1 && (S[i+1]=="AC" || S[i+1]=="BC")){
                    C++;
                    A--;
                    action.push_back('C');
                }else{
                    A++;
                    C--;
                    action.push_back('A');
                }
            }

        }
        //cout<<A<<" "<<B<<" "<<C<<endl;
        if(A<0 || B<0 || C<0){
            ans=0;
            break;
        }
    }
    if(S[N-1]=="AB"){
        if(A==0){
            A++;
            B--;
            action.push_back('A');
        }else{
            A--;
            B++;
            action.push_back('B');
        }
    }else if(S[N-1]=="BC"){
        if(B==0){
            B++;
            C--;
            action.push_back('B');
        }else{
            B--;
            C++;
            action.push_back('C');
        }
    }else{
        if(A==0){
            A++;
            C--;
            action.push_back('A');
        }else{
            A--;
            C++;
            action.push_back('C');
        }
    }
    //cout<<A<<" "<<B<<" "<<C<<endl;
    if(A<0 || B<0 || C<0){
        ans=0;
    }


    if(ans){
        cout<<"Yes"<<endl;
        for(auto p:action){
            cout<<p<<endl;
        }
    }else{
        cout<<"No"<<endl;
    }

    return 0;
}

Measured memory_bytes: 6716