/******************************************
* NICK : nikhilsinghh59 *
******************************************/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\n"

#define PB push_back
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
const int M = 1e9+7;

int main()
{   


    ll n , a , b , c;
    cin >> n >> a >> b >> c;

    vector<string>v(n);
    for(ll i=0;i<n;i++){
        cin >> v[i];
        //cout <<
    }

    string ans;

    for(ll i=0;i<n;i++) {

        string s = v[i];
        //cin >> s;

        //ll n1 , n2;
        if(s == "AB") {
            if(a==0 && b==0) {
                cout << "No";
                return 0;
            }
            else if(a==1 && b==1) {
                if(i==n-1) {
                    ans+='A';
                    
                }
                else {
                    if(v[i+1][0]=='A' || v[i+1][1]=='A') {
                        ans+='A';
                        a++;
                        b--;
                    }
                    else {
                        ans+='B';
                        a--;
                        b++;
                    }
                }
            }
            else {
                if(a > b) {
                    a--;
                    b++;
                    ans.push_back('B');
                }
                else {
                    a++;
                    b--;
                    ans.push_back('A');
                }
            }
        }
        else if(s == "AC") {
            if(a==0 && c==0) {
                cout << "No";
                return 0;
            }
            else if(a==1 && c==1) {
                if(i==n-1) {
                    ans+='A';
                }
                else {
                    if(v[i+1][0]=='A' || v[i+1][1]=='A') {
                        ans+='A';
                        a++;
                        c--;
                    }
                    else {
                        ans+='C';
                        a--;
                        c++;
                    }
                }
            }
            else {
                if(a > c) {
                    a--;
                    c++;
                    ans.push_back('C');
                }
                else {
                    a++;
                    c--;
                    ans.push_back('A');
                }
            }
        }
        else {
             if(b==0 && c==0) {
                cout << "No";
                return 0;
            }
            else if(b==1 && c==1) {
                if(i==n-1) {
                    ans+='B';
                }
                else {
                    if(v[i+1][0]=='B' || v[i+1][1]=='B') {
                        ans+='B';
                        b++;
                        c--;
                    }
                    else {
                        ans+='C';
                        b--;
                        c++;
                    }
                }
            }
            else {
                if(b > c) {
                    b--;
                    c++;
                    ans.push_back('C');
                }
                else {
                    b++;
                    c--;
                    ans.push_back('B');
                }
            }
        }

    } 

    cout << "Yes\n";
    for(auto it : ans) {
        cout << it << endl;
    }
    
    return 0;
}

Measured memory_bytes: 6704