#include <bits/stdc++.h>
using namespace std;

int main() {
    int64_t N,A,B,C;
    cin >> N >> A >> B >> C;
    vector<string> S(N);
    for ( int64_t i = 0; i < N; ++i){
        cin >> S[i];
    }
    
    int64_t sum = A + B + C;
    vector<int64_t> ABC(3);
    ABC[0] = A;
    ABC[1] = B;
    ABC[2] = C;
    if ( sum == 0 ){
        cout << "No" << endl;
    } else if ( sum == 1 ){
        vector<string> ans(N);
        bool flg = true;
        for ( int64_t i = 0; i < N; ++i){
            int64_t x0,x1;
            x0 = S[i][0] - 'A';
            x1 = S[i][1] - 'A';
            if ( ABC[x0] == 0 and ABC[x1] == 0 ){
                flg = false;
                break;
            } else if ( ABC[x0] == 1 ){
                ABC[x0] = 0;
                ABC[x1] = 1;
                ans[i] = S[i][1];
            } else {
                ABC[x0] = 1;
                ABC[x1] = 0;
                ans[i] = S[i][0];
            }
        }
        if ( flg ){
            cout << "Yes" << endl;
            for ( int64_t i = 0; i < N; ++i){
                cout << ans[i] << endl;
            }
        } else {
            cout << "No" << endl;
        }
    } else {
        int64_t x0,x1;
        x0 = S[0][0] - 'A';
        x1 = S[0][1] - 'A';
        if ( ABC[x0] == 0 and ABC[x1] == 0 ){
            cout << "No" << endl;
        } else {
            cout << "Yes" << endl;
            vector<string> ans(N);
            for ( int64_t i = 0; i < N-1; ++i){
                x0 = S[i][0] - 'A';
                x1 = S[i][1] - 'A';
                if ( ABC[x0] == 0 ){
                    ABC[x0] = 1;
                    ABC[x1] = ABC[x1] - 1;
                    ans[i] = S[i][0];
                } else if ( ABC[x1] == 0 ){
                    ABC[x0] = ABC[x0] - 1;
                    ABC[x1] = 1;
                    ans[i] = S[i][1];
                } else if ( ABC[x0] == 1 and ABC[x1] == 1){
                    int64_t y0,y1;
                    y0 = S[i+1][0] - 'A';
                    y1 = S[i+1][1] - 'A';
                    if ( x0 + x1 == y0 + y1 ){
                        ABC[x0] = ABC[x0] + 1;
                        ABC[x1] = ABC[x1] - 1;
                        ans[i] = S[i][0];
                    } else if ( x0 == y0 or x0 == y1 ){
                        ABC[x0] = ABC[x0] + 1;
                        ABC[x1] = ABC[x1] - 1;
                        ans[i] = S[i][0];
                    } else {
                        ABC[x0] = ABC[x0] - 1;
                        ABC[x1] = ABC[x1] + 1;
                        ans[i] = S[i][1];
                    }
                } else {
                    if ( ABC[x0] >= ABC[x1] ){
                        ABC[x0] = ABC[x0] - 1;
                        ABC[x1] = ABC[x1] + 1;
                        ans[i] = S[i][1];
                    } else {
                        ABC[x0] = ABC[x0] + 1;
                        ABC[x1] = ABC[x1] - 1;
                        ans[i] = S[i][0];
                    }
                }
            }
            x0 = S[N-1][0] - 'A';
            x1 = S[N-1][1] - 'A';
            if ( ABC[x0] == 0 ){
                ans[N-1] = S[N-1][0];
            } else {
                ans[N-1] = S[N-1][1];
            }
            for ( int64_t i = 0; i < N; ++i){
                cout << ans[i] << endl;
            }
        }
        
        
    }
    
    
    return 0;
}

Measured memory_bytes: 9576