#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define _GLIBCXX_DEBUG
#define fi first
#define se second

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vvd = vector<vd>;
using vvvi = vector<vvi>;
using vvvll = vector<vvll>;
using vvvd = vector<vvd>;

const double pi=acos(-1);
const ll MOD=1e9+7;
const ll INF=(1LL<<60);

int main() {
    ll n,a,b,c;
    cin>>n>>a>>b>>c;
    string v[n+1];
    rep(i,n)cin>>v[i];
    v[n]="";
        char ans[n];
        char x='A',y='B',z='C';
        rep(i,n){
            if (v[i]=="AB"){
                if (a>b){
                    ans[i]=y;
                    a--;
                    b++;
                }
                else if(a<b){
                    ans[i]=x;
                    a++;
                    b--;
                }
                else{
                    if (a==0){
                        cout<<"No"<<endl;
                        return 0;
                    }
                    else{
                        if (v[i+1]=="BC"){
                            ans[i]=y;
                            b++;
                            a--;
                        }
                        else if (v[i+1]=="AC"){
                            ans[i]=x;
                            a++;
                            b--;
                        }
                        else{
                            ans[i]=x;
                            a++;
                            b--;
                        }
                    }
                }
            }

            else if (v[i]=="AC"){
                if (a>c){
                    ans[i]=z;
                    a--;
                    c++;
                }
                else if(a<c){
                    ans[i]=x;
                    a++;
                    c--;
                }
                else{
                    if (a==0){
                        cout<<"No"<<endl;
                        return 0;
                    }
                    else{
                        if (v[i+1]=="BC"){
                            ans[i]=z;
                            c++;
                            a--;
                        }
                        else if (v[i+1]=="AB"){
                            ans[i]=x;
                            a++;
                            c--;
                        }
                        else{
                            ans[i]=x;
                            a++;
                            c--;
                        }
                    }
                }
            }


            else {
                if (b>c){
                    ans[i]=z;
                    b--;
                    c++;
                }
                else if(b<c){
                    ans[i]=y;
                    b++;
                    c--;
                }
                else{
                    if (b==0){
                        cout<<"No"<<endl;
                        return 0;
                    }
                    else{
                        if (v[i+1]=="AC"){
                            ans[i]=z;
                            c++;
                            b--;
                        }
                        else if (v[i+1]=="AB"){
                            ans[i]=y;
                            b++;
                            c--;
                        }
                        else{
                            ans[i]=y;
                            b++;
                            c--;
                        }
                    }
                }
            }
        }

        cout<<"Yes"<<endl;
        rep(i,n)cout<<ans[i]<<endl;
    


    return 0;
}

Measured memory_bytes: 6836