#include<bits/stdc++.h>

int main(){
    using namespace std;
    unsigned long N, A, B, C;
    cin >> N >> A >> B >> C;
    if(A + B + C < 3){
        vector dp(N + 1, vector(3, vector(3, 0)));
        dp[0][A][B] = 1;
        for(unsigned long i{1}; i <= N; ++i){
            string S;
            cin >> S;
            unsigned long _a{0}, _b{0}, _c{0}, _ab{0}, _ac{0}, _bc{};
            if(S == "AB")_a = _b = _ab = 1;
            if(S == "AC")_a = _c = _ac = 1;
            if(S == "BC")_b = _c = _bc = 1;
            for(unsigned long j{0}; j < 9; ++j)if(auto [a, b] = pair<unsigned long, unsigned long>{j / 3, j % 3}; dp[i - 1][a][b]){
                    auto c = A + B + C - a - b;
                    if(!(a * _a + b * _b + c * _c))continue;
                    if(_ab){
                        if(a)dp[i][a - 1][b + 1] = j + 1;
                        if(b)dp[i][a + 1][b - 1] = j + 1;
                    }
                    if(_ac){
                        if(a)dp[i][a - 1][b] = j + 1;
                        if(c)dp[i][a + 1][b] = j + 1;
                    }
                    if(_bc){
                        if(b)dp[i][a][b - 1] = j + 1;
                        if(c)dp[i][a][b + 1] = j + 1;
                    }
                }
        }
        if(none_of(dp.back().begin(), dp.back().end(), [](const auto& i){return any_of(i.begin(), i.end(), [](const auto& j){return j;});}))return 0 & puts("No");
        vector<char> c;
        unsigned long beg{0};
        for(unsigned long j{0}; j < 9; ++j)if(auto [a, b] = pair<unsigned long, unsigned long>{j / 3, j % 3}; dp.back()[a][b])beg = j;
        for(unsigned long i{N}, j{beg}; i > 0; --i){
            auto [a, b] = pair<unsigned long, unsigned long>{j / 3, j % 3};
            unsigned long k{j + 1 - dp[i][a][b]};
            if(k == 3 || k == 2)c.push_back('A');
            if(k == 1 || k == -2)c.push_back('B');
            if(k == -3 || k == -1)c.push_back('C');
            j = dp[i][a][b] - 1;
        }
        reverse(c.begin(), c.end());
        puts("Yes");
        for(const auto& i : c)cout << i << endl;
    }else{
        string c{"Yes\n"};
        for(unsigned long i{0}; i < N; ++i){
            string S;
            cin >> S;
            if(S == "AB"){
                if(A == 0 && B == 0)return 0 & puts("No");
                if(A > B){
                    c.push_back('B');
                    --A;
                    ++B;
                }else{
                    c.push_back('A');
                    ++A;
                    --B;
                }
            }else if(S == "BC"){
                if(B == 0 && C == 0)return 0 & puts("No");
                if(C > B){
                    c.push_back('B');
                    --C;
                    ++B;
                }else{
                    c.push_back('C');
                    ++C;
                    --B;
                }
            }else{
                if(A == 0 && C == 0)return 0 & puts("No");
                if(C > A){
                    c.push_back('A');
                    --C;
                    ++A;
                }else{
                    c.push_back('C');
                    ++C;
                    --A;
                }
            }
            c.push_back('\n');
        }
        cout << c;
    }
    return 0;
}

Measured memory_bytes: 23108