#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define time_taken_start int begtime = clock();
#define time_taken_end int endtime = clock(); \
cerr << "\n\n" << "Time elapsed: " << \
(endtime - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n"; \
return 0;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define mod 1000000007
#define inf 1000000000000000007
#define eps 0.0000000001
#define pi acosl(-1)
#define pdd pair<ld,ld>
#define pll pair<ll,ll>
#define ff first
#define ss second
#define vpl vector<pll>
#define vll vector<ll>
#define mseti multiset <ll>
#define msetd multiset <ll,greater<ll>>
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound 
#define stp fixed<<setprecision(20)
#define endl '\n'
vector<char> ans;
bool dp[100009][3][3][3];
pll pre[100009][3][3][3];
void print(ll n,ll a,ll b,ll c)
{
    cout<<"Yes"<<endl;
    for(ll i=n;i>0;i--)
    {
        ll y=pre[i][a][b][c].ff;
        ll x=pre[i][a][b][c].ss;
        if(x==1)
        {
            ans.pb('A');
            a--;
        }
        if(x==2)
        {
            ans.pb('B');
            b--;
        }
        if(x==3)
        {
            ans.pb('C');
            c--;
        }
        if(y==1)
            a++;
        if(y==2)
            b++;
        if(y==3)
            c++;
    }
    for(ll i=n-1;i>=0;i--)
        cout<<ans[i]<<endl;
}
void solve()
{
    ll a,b,c,n;
    cin>>n>>a>>b>>c;
    string s;
    if((a+b+c)>=3)
    {
        for(ll i=0;i<n;i++)
        {
            cin>>s;
            if(s=="AB")
            {
                if(a==0&&b==0)
                {
                    cout<<"No";
                    return;
                }
                if(a>b)
                {
                    a--;
                    b++;
                    ans.pb('B');
                }
                else
                {
                    a++;
                    b--;
                    ans.pb('A');
                }
            }
            if(s=="BC")
            {
                if(c==0&&b==0)
                {
                    cout<<"No";
                    return;
                }
                if(c>b)
                {
                    c--;
                    b++;
                    ans.pb('B');
                }
                else
                {
                    c++;
                    b--;
                    ans.pb('C');
                }
            }
            if(s=="AC")
            {
                if(a==0&&c==0)
                {
                    cout<<"No";
                    return;
                }
                if(a>c)
                {
                    a--;
                    c++;
                    ans.pb('C');
                }
                else
                {
                    a++;
                    c--;
                    ans.pb('A');
                }
            }
        }
        cout<<"Yes"<<endl;
        for(auto i:ans)
            cout<<i<<endl;
    }
    else
    {
        dp[0][a][b][c]=1;
        for(ll i=1;i<=n;i++)
        {
            cin>>s;
            for(ll j1=0;j1<3;j1++)
            {
                for(ll j2=0;j2<3;j2++)
                {
                    for(ll j3=0;j3<3;j3++)
                    {
                        if(j1>0&&j2<2&&s=="AB")
                        {
                            dp[i][j1][j2][j3]|=dp[i-1][j1-1][j2+1][j3];
                            if(dp[i-1][j1-1][j2+1][j3]==1){
                            pre[i][j1][j2][j3].ff=2;
                            pre[i][j1][j2][j3].ss=1;}
                        }
                        if(j2>0&&j1<2&&s=="AB")
                        {
                            dp[i][j1][j2][j3]|=dp[i-1][j1+1][j2-1][j3];
                            if(dp[i-1][j1+1][j2-1][j3]==1){
                            pre[i][j1][j2][j3].ff=1;
                            pre[i][j1][j2][j3].ss=2;}
                        }
                        if(j1>0&&j3<2&&s=="AC")
                        {
                            dp[i][j1][j2][j3]|=dp[i-1][j1-1][j2][j3+1];
                            if(dp[i-1][j1-1][j2][j3+1]==1){
                            pre[i][j1][j2][j3].ff=3;
                            pre[i][j1][j2][j3].ss=1;}
                        }
                        if(j3>0&&j1<2&&s=="AC")
                        {
                            dp[i][j1][j2][j3]|=dp[i-1][j1+1][j2][j3-1];
                            if(dp[i-1][j1+1][j2][j3-1]==1){
                            pre[i][j1][j2][j3].ff=1;
                            pre[i][j1][j2][j3].ss=3;}
                        }
                        if(j3>0&&j2<2&&s=="BC")
                        {
                            dp[i][j1][j2][j3]|=dp[i-1][j1][j2+1][j3-1];
                            if(dp[i-1][j1][j2+1][j3-1]==1){
                            pre[i][j1][j2][j3].ff=2;
                            pre[i][j1][j2][j3].ss=3;}
                        }
                        if(j2>0&&j3<2&&s=="BC")
                        {
                            dp[i][j1][j2][j3]|=dp[i-1][j1][j2-1][j3+1];
                            if(dp[i-1][j1][j2-1][j3+1]==1){
                            pre[i][j1][j2][j3].ff=3;
                            pre[i][j1][j2][j3].ss=2;}
                        }
                    }
                }
            }
        }
        for(ll j1=0;j1<3;j1++)
        {
            for(ll j2=0;j2<3;j2++)
            {
                for(ll j3=0;j3<3;j3++)
                {
                    if(dp[n][j1][j2][j3]==1)
                    {
                        print(n,j1,j2,j3);
                        return;
                    }
                }
            }
        }
        cout<<"No";
    }
}
int main()
{
    FAST
    #ifdef ayk_16
    freopen("input.txt","rt",stdin);
    freopen("output.txt","wt",stdout);
    #endif
    ll t=1;
    //cin>>t;
    for(ll i=0;i<t;i++)
    {
        //cout<<"Case #"<<i+1<<": ";
        solve();
    }
}

Measured memory_bytes: 48620