//Author rahuliitkgp
/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define ff              first
#define ss              second
#define SZ(x)           ((int)(x).size())
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//#ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
//#endif
}

int main(){
    cpp();
    ll n, a, b, c;
    cin>>n>>a>>b>>c;
    vector<char> v;
    int flag  = 0;
    vector<string> q(n);
    for(ll i=0; i<n; i++){
        cin>>q[i];
    }
    for(ll i=0; i<n; i++){
        string s = q[i];
        if(s=="AB"){
            if(a==1&&b==1&&c==0){
                if(i<n-1){
                    if(q[i+1]=="AC"){
                        a++;
                        b--;
                        v.push_back('A');
                    }
                    else if(q[i+1]=="BC"){
                        b++;
                        a--;
                        v.push_back('B');
                    }
                    else{
                        a--;
                        b++;
                        v.push_back('B');
                    }
                }
                else{
                    a--;
                    b++;
                    v.push_back('B');
                }
            }
            else if(a<b){
                a++;
                b--;
                if(b<0){
                    flag =1;
                }
                v.push_back('A');
            }
            else{
                a--;
                b++;
                if(a<0){
                    flag =1;
                }
                v.push_back('B');
            }
        }
        else if(s=="AC"){
            if(a==1&&c==1&&b==0){
                if(i<n-1){
                    if(q[i+1]=="AB"){
                        a++;
                        c--;
                        v.push_back('A');
                    }
                    else if(q[i+1]=="BC"){
                        c++;
                        a--;
                        v.push_back('C');
                    }
                    else{
                        a++;
                        c--;
                        v.push_back('A');
                    }
                }
                else{
                    a++;
                    c--;
                    v.push_back('A');
                }
            }
            else if(a<c){
                a++;
                c--;
                if(c<0){
                    flag =1;
                }
                v.push_back('A');
            }
            else{
                a--;
                c++;
                if(a<0){
                    flag =1;
                }
                v.push_back('C');
            }
        }
        else{
            //BC
            if(b==1&&c==1&&a==0){
                if(i<n-1){
                    if(q[i+1]=="AB"){
                        b++;
                        c--;
                        v.push_back('B');
                    }
                    else if(q[i+1]=="AC"){
                        c++;
                        b--;
                        v.push_back('C');
                    }
                    else{
                        b++;
                        c--;
                        v.push_back('B');
                    }
                }
                else{
                    b++;
                    c--;
                    v.push_back('B');
                }
            }
            else if(b<c){
                b++;
                c--;
                if(c<0){
                    flag =1;
                }
                v.push_back('B');
            }
            else{
                b--;
                c++;
                if(b<0){
                    flag =1;
                }
                v.push_back('C');
            }
        }
    }
    if(flag){
        cout<<"No"<<endl;
    }
    else{
        cout<<"Yes"<<endl;
        for(char& ch: v){
            cout<<ch<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 6652