#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(void){
    int N, A, B, C;
    string sbuf;
    vector<string> s;
    vector<string> choice;
    bool completable = true;
    cin >> N >> A >> B >> C;
    for(int i=0; i<N; i++){
        cin >> sbuf;
        s.push_back(sbuf);
    }
    for(int i=0; i<N; i++){
        if(s[i] == "AB"){
            if(A > 1){
                A--;
                B++;
                choice.push_back("B");
                continue;
            }
            if(B > 1){
                A++;
                B--;
                choice.push_back("A");
                continue;
            }
            if((A == 0)&&(B == 0)){
                completable = false;
                break;
            }
            if(A == 0){
                A++;
                B--;
                choice.push_back("A");
                continue;
            }
            if(B == 0){
                A--;
                B++;
                choice.push_back("B");
                continue;
            }
            if(i == N-1){
                A++;
                B--;
                choice.push_back("A");
                continue;
            }
            if((s[i+1] == "AB")||(s[i+1] == "AC")){
                A++;
                B--;
                choice.push_back("A");
                continue;
            }
            A--;
            B++;
            choice.push_back("B");
            continue;
        }
        if(s[i] == "AC"){
            if(A > 1){
                A--;
                C++;
                choice.push_back("C");
                continue;
            }
            if(C > 1){
                A++;
                C--;
                choice.push_back("A");
                continue;
            }
            if((A == 0)&&(C == 0)){
                completable = false;
                break;
            }
            if(A == 0){
                A++;
                C--;
                choice.push_back("A");
                continue;
            }
            if(C == 0){
                A--;
                C++;
                choice.push_back("C");
                continue;
            }
            if(i == N-1){
                A++;
                C--;
                choice.push_back("A");
                continue;
            }
            if((s[i+1] == "AC")||(s[i+1] == "AB")){
                A++;
                C--;
                choice.push_back("A");
                continue;
            }
            A--;
            C++;
            choice.push_back("C");
            continue;
        }
        if(s[i] == "BC"){
            if(B > 1){
                B--;
                C++;
                choice.push_back("C");
                continue;
            }
            if(C > 1){
                B++;
                C--;
                choice.push_back("B");
                continue;
            }
            if((B == 0)&&(C == 0)){
                completable = false;
                break;
            }
            if(B == 0){
                B++;
                C--;
                choice.push_back("B");
                continue;
            }
            if(C == 0){
                B--;
                C++;
                choice.push_back("C");
                continue;
            }
            if(i == N-1){
                B++;
                C--;
                choice.push_back("B");
                continue;
            }
            if((s[i+1] == "BC")||(s[i+1] == "AB")){
                B++;
                C--;
                choice.push_back("B");
                continue;
            }
            B--;
            C++;
            choice.push_back("C");
            continue;
        }
    }
    if(completable){
        cout << "Yes" << endl;
        for(int i=0; i<N; i++){
            cout << choice[i] << endl;
        }
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 12404