//***The night is the darkest just before the dawn***
 
#include<bits/stdc++.h>
using namespace std;
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long 
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
 
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;
 
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

int main(){
    ll n,a,b,c,f=0;
    cin>>n>>a>>b>>c;

    string s[n];
    forn(i,n) cin>>s[i];
    vector<char> v;

    forn(i,n){
        if(s[i]=="AB"){
            if((a==0)&&(b==0)){
                f=1;
                break;
            }
            if((a==1)&&(b==1)&&(c==0)&&(i<(n-1))){
                if(s[i+1]=="AC") {
                    a++;
                    b--;
                    v.pb('A');
                }
                else if(s[i+1]=="BC"){
                    b++;
                    a--;
                    v.pb('B');
                }
                else{
                    b++;
                    a--;
                    v.pb('B');
                }
                continue;
            }
            if(a>b){
                a--;
                b++;
                v.pb('B');
            }
            else {
                a++;
                b--;
                v.pb('A');
            }
        }
        if(s[i]=="BC"){
            if((c==0)&&(b==0)){
                f=1;
                break;
            }
            if((c==1)&&(b==1)&&(a==0)&&(i<(n-1))){
                if(s[i+1]=="AC") {
                    c++;
                    b--;
                    v.pb('C');
                }
                else{
                    b++;
                    c--;
                    v.pb('B');
                }
                continue;
            }
            if(c>b){
                c--;
                b++;
                v.pb('B');
            }
            else {
                c++;
                b--;
                v.pb('C');
            }
        }
        if(s[i]=="AC"){
            if((a==0)&&(c==0)){
                f=1;
                break;
            }
            if((a==1)&&(c==1)&&(b==0)&&(i<(n-1))){
                if(s[i+1]=="AB") {
                    a++;
                    c--;
                    v.pb('A');
                }
                else{
                    c++;
                    a--;
                    v.pb('C');
                }
                continue;
            }
            if(a>c){
                a--;
                c++;
                v.pb('C');
            }
            else {
                a++;
                c--;
                v.pb('A');
            }
        }
    }
    if(f==1) cout<<"No";
    else{
        cout<<"Yes\n";
        forn(i,v.size()) cout<<v[i]<<"\n";
    }
}

Measured memory_bytes: 6860