#include <vector>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <functional>
#include <map>
#include <array>
#include <cmath>
#include <set>
#include <numeric>

using namespace std;

template <typename T>
using TABLE = vector<vector<T>>;

long long PRIME = 1e9 + 7;
long long PRIME2 = 998244353;


int check(long long& a, long long& b, long long& c, int next_type){
    /*
        next_type : 0: a, b  1: a, c  2: b, c
    */
    if(a == 0 && b == 0){
        return -1;
    }

    if(next_type == 0){
        if(a == 0){
            --b;
            ++a;
            return 0;
        }
        ++b;
        --a;
        return 1;
    }
    else if(next_type == 1){
        if(c == 0){
            if(b == 0){
                if(a == 1){
                    return -1;
                }
                --a;
                ++b;
                return 1;
            }
            else{
                ++a;
                --b;
                return 0;
            }
        }
        else{
            if(b == 0){
                --a;
                ++b;
                return 1;
            }
            ++a;
            --b;
            return 0;
        }
    }
    else{
        if(c == 0){
            if(a == 0){
                if(b == 1){
                    return -1;
                }
                ++a;
                --b;
                return 0;
            }
            else{
                --a;
                ++b;
                return 1;
            }
        }
        else{
            if(a == 0){
                ++a;
                --b;
                return 0;
            }
            --a;
            ++b;
            return 1;
        }
    }
}


int main(){
    long long N, A, B, C;
    cin >> N >> A >> B >> C;

    vector<string> s(N);
    vector<char> r(N);

    for(int i = 0; i < N; ++i){
        cin >> s.at(i);
    }

    if(A + B + C == 0){
        cout << "No";
        return 0;
    }

    map<string, int> next_table;
    next_table["ABAB"] = 0;
    next_table["ABAC"] = 1;
    next_table["ABBC"] = 2;

    next_table["ACAC"] = 0;
    next_table["ACAB"] = 1;
    next_table["ACBC"] = 2;

    next_table["BCBC"] = 0;
    next_table["BCAB"] = 1;
    next_table["BCAC"] = 2;

    for(int i = 0; i < N - 1; ++i){
        if(s[i] == "AB"){
            int res = check(A, B, C, next_table[s[i] + s[i + 1]]);

            if(res == -1){
                cout << "No";
                return 0;
            }

            if(res == 0){
                r[i] = 'A';
            }
            else{
                r[i] = 'B';
            }
        }
        else if(s[i] == "AC"){
            int res = check(A, C, B, next_table[s[i] + s[i + 1]]);

            if(res == -1){
                cout << "No";
                return 0;
            }

            if(res == 0){
                r[i] = 'A';
            }
            else{
                r[i] = 'C';
            }
        }
        else{
            int res = check(B, C, A, next_table[s[i] + s[i + 1]]);

            if(res == -1){
                cout << "No";
                return 0;
            }

            if(res == 0){
                r[i] = 'B';
            }
            else{
                r[i] = 'C';
            }
        }
    }

    if(s[N-1] == "AB"){
        if(A == 0 && B == 0){
            cout << "No";
            return 0;
        }
        else if(A > B){
            r[N-1] = 'B';
        }
        else{
            r[N-1] = 'A';
        }
    }
    else if(s[N-1] == "AC"){
        if(A == 0 && C == 0){
            cout << "No";
            return 0;
        }
        else if(A > C){
            r[N-1] = 'C';
        }
        else{
            r[N-1] = 'A';
        }
    }
    else if(s[N-1] == "BC"){
        if(B == 0 && C == 0){
            cout << "No";
            return 0;
        }
        else if(C > B){
            r[N-1] = 'B';
        }
        else{
            r[N-1] = 'C';
        }
    }

    cout << "Yes" << endl;
    for(int i = 0; i < N; ++i){
        cout << r[i] << endl;
    }
}


Measured memory_bytes: 6436