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

int n;

int a[3];
const int maxn = 1e5 + 5;
int dp[maxn][30];
pair<char, int> pre[maxn][30];

int id(vector<int> v){
    int ret = 0;
    for(int i = 0;i < 3;i++){
        ret = ret * 3 + v[i];
    }
    return ret;
}

vector<int> id2s(int S){
    vector<int> ret; 
    for(int i = 0;i < 3;i++){
        ret.push_back(S % 3);
        S /= 3;
    }
    reverse(ret.begin(), ret.end());
    return ret;
}

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n;
    long long sum = 0;
    for(int i = 0;i < 3;i++){
        cin >> a[i];
        sum += a[i];
    }
    if(sum == 0){
        string s;
        for(int i = 1;i <= n;i++){
            cin >> s;
        }
        cout << "No" << endl;
    }else if(sum == 1 or sum >= 3){
        string ans = "";
        bool flag = true;
        for(int i = 1;i <= n;i++){
            string s; 
            cin >> s;
            int u = s[0] - 'A';
            int v = s[1] - 'A';
            if(a[u] == 0 and a[v] == 0)
                flag = false;
            else{
                if(a[u] > a[v]){
                    a[v]++;
                    a[u]--;
                    ans.push_back(s[1]);
                }else{
                    a[u]++;
                    a[v]--;
                    ans.push_back(s[0]);
                }
            }
        }    
        if(flag){
            cout << "Yes" << endl;
            for(int i = 0;i < n;i++){
                cout << ans[i] << endl;
            }
        }else{
            cout << "No" << endl;
        }
    }else{
        vector<int> tmp(3);
        for(int i = 0;i < 3;i++){
            tmp[i] = a[i];
        }        
        int st = id(tmp);
        memset(dp, 0, sizeof(dp));
        dp[0][st] = 1;
        for(int i = 1;i <= n;i++){
            string s;
            cin >> s;
            int u = s[0] - 'A';
            int v = s[1] - 'A';
            for(int S = 0; S < 27;S++){
                if(dp[i - 1][S] == 0)
                    continue;
                vector<int> state = id2s(S);
                if(state[u] > 0){
                    vector<int> tmp1(3); 
                    tmp1 = state;
                    tmp1[u]--;
                    tmp1[v]++;
                    int to = id(tmp1);
                    dp[i][to] = 1;
                    pre[i][to] = make_pair(s[1], S);
                }
                if(state[v] > 0){
                    vector<int> tmp1(3); 
                    tmp1 = state;
                    tmp1[u]++;
                    tmp1[v]--;
                    int to = id(tmp1);
                    dp[i][to] = 1;
                    pre[i][to] = make_pair(s[0], S);
                }
            }
        }
        bool flag = false;
        int dest = -1;
        for(int i = 0;i < 27;i++){
            if(dp[n][i] == 1){
                flag = true;
                dest = i;
            }
        }
        if(flag){
            cout << "Yes" << endl;
            string ans = "";
            for(int i = n;i >= 1;i--){
                pair<char, int> trans = pre[i][dest];
                dest = trans.second;
                ans.push_back(trans.first);
            }
            reverse(ans.begin(), ans.end());
            for(int i = 0;i < n;i++){
                cout << ans[i] << endl;
            }
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 38952