#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))
 
using namespace std;
 
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
 
const ll INF=1e9+7;

int main(){
    ll n;
    cin>> n;
    vector<ll> a(3);
    ll sum=0;
    rep(i,3){
        cin >> a[i];
        sum+=a[i];
    }
    vector<string> s(n);
    rep(i,n){
        cin >>s[i];
    }
    if(sum==0){
        cout << "No" << endl;
        return 0;
    }
    else if(sum>2){
        char c=s[0][0];
        char d=s[0][1];
        ll x=c-'A';
        ll y=d-'A';
        if(a[x]==0 && a[y]==0){
            cout << "No" << endl;
            return 0;
        }
        else{
            cout << "Yes" << endl;
            rep(i,n){
                char e=s[i][0];
                char f=s[i][1];
                ll z=e-'A';
                ll w=f-'A';
                char ans;
                
                if(a[z]>a[w]){
                    ans=(char)('A'+w);
                    a[z]--;
                    a[w]++;
                    cout << ans << endl;
                }
                else{
                    ans=(char)('A'+z);
                    a[z]++;
                    a[w]--;
                    cout << ans << endl;
                }
            }
        }
    }
    else if(sum==2){
        char c=s[0][0];
        char d=s[0][1];
        ll x=c-'A';
        ll y=d-'A';
        if(a[x]==0 && a[y]==0){
            cout << "No" << endl;
            return 0;
        }
        else{
            cout << "Yes" << endl;
            rep(i,n){
                char e=s[i][0];
                char f=s[i][1];
                ll z=e-'A';
                ll w=f-'A';
                char ans;
                if(a[z]==1 && a[w]==1){
                    if(i<=n-2 && s[i+1]!=s[i]){
                        if(s[i][0]==s[i+1][0] || s[i][0]==s[i+1][1]){
                            ans=(char)('A'+z);
                            a[z]++;
                            a[w]--;
                            cout << ans << endl;
                            continue;
                        }
                        else{
                            ans=(char)('A'+w);
                            a[w]++;
                            a[z]--;
                            cout << ans << endl;
                            continue;
                        }
                    }
                }
                if(a[z]>=a[w]){
                    ans=(char)('A'+w);
                    a[z]--;
                    a[w]++;
                    cout << ans << endl;
                }
                else{
                    ans=(char)('A'+z);
                    a[z]++;
                    a[w]--;
                    cout << ans << endl;
                }
            }
        }
    }
    else{
        bool ok=true;
        vector<char> ans;
        rep(i,n+1){
            if(i==n){
                if(a[0]<0 || a[1]<0 || a[2]<0){
                    ok=false;
                }
                break;
            }
            char e=s[i][0];
            char f=s[i][1];
            ll z=e-'A';
            ll w=f-'A';
            
            if(a[z]==0 && a[w]==0){
                ok=false;
                break;
            }
            if(a[z]>a[w]){
                char g=(char)('A'+w);
                a[z]--;
                a[w]++;
                ans.push_back(g);
            }
            else{
                char g=(char)('A'+z);
                a[z]++;
                a[w]--;
                ans.push_back(g);
            }
        }
        if(ok){
            cout << "Yes" << endl;
            rep(i,n){
                cout << ans[i] << endl;
            }
        }
        else{
            cout << "No" << endl;
        }
    }
    return 0;
} 

Measured memory_bytes: 6672