//2020-05-03 22:14:35
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
const int SIZE = 100000;

int main() {
    cin.tie(nullptr); ios::sync_with_stdio(false);
    int N, A, B, C; cin >> N >> A >> B >> C;
    vector<int> state;
    state.push_back(A);state.push_back(B);state.push_back(C);
    vector<pair<int, int>> S;
    for (int i = 0; i < N; i++){
        string s; cin >> s;
        if (s[0] == 'A' && s[1] == 'B')
            S.push_back(make_pair(0,1));
        if (s[0] == 'A' && s[1] == 'C')
            S.push_back(make_pair(0,2));
        if (s[0] == 'B' && s[1] == 'C')
            S.push_back(make_pair(1,2));
    }
    if (state[0]+state[1]+state[2] == 0)
    {
        cout << "No" << endl;
        return 0;
    }
    vector<int> ans;
    if (state[0]+state[1]+state[2] == 1)
    {
        for (int i = 0; i < N; i++)
        {
            if (state[S[i].first] + state[S[i].second] == 0)
            {
                cout << "No" << endl;
                return 0;
            }
            if (state[S[i].first] == 1)
            {
                ans.push_back(S[i].second);
                state[S[i].first]--;
                state[S[i].second]++;
            }
            else
            {
                ans.push_back(S[i].first);
                state[S[i].first]++;
                state[S[i].second]--;
            }            
        }
        cout << "Yes" << endl;
        for (int i = 0; i < N; i++)
        {
            if (ans[i] == 0)cout << 'A' << endl;
            if (ans[i] == 1)cout << 'B' << endl;
            if (ans[i] == 2)cout << 'C' << endl;
        }
        return 0;
    }
    if (state[0]+state[1]+state[2] == 2){
        if (state[S[0].first] == 0 && state[S[0].second] == 0)
        {
            cout << "No" << endl;
            return 0;
        }
        for (int i = 0; i < N-1; i++)
        {
            if (state[S[i].first] == 2)
            {
                ans.push_back(S[i].second);
                state[S[i].first] = state[S[i].second] = 1; 
                continue;
            }
            if (state[S[i].second] == 2)
            {
                ans.push_back(S[i].first);
                state[S[i].first] = state[S[i].second] = 1; 
                continue;
            }
            if (state[S[i].first] == 0 && state[S[i].second] == 1){
                ans.push_back(S[i].first);
                state[S[i].first] = 1;
                state[S[i].second] = 0;
                continue;
            }
            if (state[S[i].first] == 1 && state[S[i].second] == 0){
                ans.push_back(S[i].second);
                state[S[i].first] = 0;
                state[S[i].second] = 1;
                continue;
            }
            if (S[i].first == S[i+1].first || S[i].first == S[i+1].second)
            {
                ans.push_back(S[i].first);
                state[S[i].first] = 2;
                state[S[i].second] = 0;
                continue;
            }
            if (S[i].second == S[i+1].first || S[i].second == S[i+1].second)
            {
                ans.push_back(S[i].second);
                state[S[i].second] = 2;
                state[S[i].first] = 0;
                continue;
            }
        }
        if (state[S[N-1].second] > 0)
            ans.push_back(S[N-1].first);
        else
            ans.push_back(S[N-1].second);
        cout << "Yes" << endl;
        for (int i = 0; i < N; i++)
        {
            if (ans[i] == 0)cout << 'A' << endl;
            if (ans[i] == 1)cout << 'B' << endl;
            if (ans[i] == 2)cout << 'C' << endl;
        }
        return 0;
    }    
    if (state[S[0].first] == 0 && state[S[0].second] == 0)
    {
        cout << "No" << endl;
        return 0;
    }

    for (int i = 0; i < N; i++)
    {
        if (state[S[i].first] <= state[S[i].second])
        {
            ans.push_back(S[i].first);
            state[S[i].first]++;
            state[S[i].second]--;
        }
        else
        {
            ans.push_back(S[i].second);
            state[S[i].first]--;
            state[S[i].second]++;
        }
        
    }
    cout << "Yes" << endl;
    for (int i = 0; i < N; i++)
    {
        if (ans[i] == 0)cout << 'A' << endl;
        if (ans[i] == 1)cout << 'B' << endl;
        if (ans[i] == 2)cout << 'C' << endl;
    }
}

Measured memory_bytes: 4816