#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007
#define inf 1e18+42
#define endl "\n"
#define pi 3.1415926535897932384626433832795028841971693993751058
#define maxn 100005

#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define fori(it,A) for(auto it=A.begin();it!=A.end();it++)

#define ft first
#define sd second
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define all(x) (x).begin(),(x).end()
#define zero(x) memset(x,0,sizeof(x));
 
using namespace std;

int binpow(int a, int b) {
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

//START OF CODE ->->->->->->->

void solve()
{
    int n,a,b,c;
    cin>>n>>a>>b>>c;

    vector<string> s(n);

    rep(i,0,s.size())
    {
        cin>>s[i];
    }

    if ( a + b + c == 0 )
    {
        cout<<"No"<<endl;
        return;
    }
    bool ok = true;
    vector<char> ans;
    rep(i,0,s.size())
    {
        if ( a + b + c == 1 )
        {
            string str = s[i];
            if ( s[i][0] == 'A' && s[i][1] == 'B' )
            {
                ok = !(a==0&&b==0);
                // break;

                if (!ok)
                {
                    break;
                }
                else
                {
                    if (a)
                    {
                        b++;
                        a--;
                        ans.pb('B');
                    }
                    else
                    {
                        a++;
                        b--;
                        ans.pb('A');
                    }
                }
                
            }
            else if ( s[i][0] == 'A' && s[i][1] == 'C' )
            {
                ok = !(a==0&&c==0);
                if (!ok)
                {
                    break;
                }
                else
                {
                    if (a)
                    {
                        a--;
                        c++;
                        ans.pb('C');
                    }
                    else
                    {
                        a++;
                        c--;
                        ans.pb('A');
                    }
                }
                
            }
            else
            {
                ok = !(b==0&&c==0);
                    // break;
                if (!ok)
                {
                    break;
                }
                else
                {
                    if (b)
                    {
                        b--;
                        c++;
                        ans.pb('C');
                    }
                    else
                    {
                        b++;
                        c--;
                        ans.pb('B');
                    }
                }
                
            }
        }
        else
        {
            if ( a + b + c == 2 )
            {
                if ( s[i][0] == 'A' && s[i][1] == 'B' )
                {
                    if( a > b )
                    {
                        a--;
                        b++;
                        ans.pb('B');
                    }
                    else if ( a < b )
                    {
                        a++;
                        b--;
                        ans.pb('A');
                    }
                    else
                    {
                        if ( i+1 != s.size() )
                        {
                            if ( s[i+1][0] == 'A' && s[i+1][1] == 'B' )
                            {
                                a--;
                                b++;
                                ans.pb('B');
                                if ( a < 0 )
                                {
                                    ok = false;
                                    break;
                                }
                            }
                            else if ( s[i+1][0] == 'A' && s[i+1][1] == 'C' )
                            {
                                a++;
                                b--;
                                ans.pb('A');
                                if ( b < 0 )
                                {
                                    ok = false;
                                    break;
                                }
                            }
                            else
                            {
                                b++;
                                a--;
                                ans.pb('B');
                                if ( a < 0 )
                                {
                                    ok = false;
                                    break;
                                }
                            } 
                        }
                        else
                        {
                            a--;
                            b++;
                            ans.pb('B');
                            if ( a < 0 )
                            {
                                ok = false;
                                break;
                            }
                        }
                    }
                    
                }
                else if ( s[i][0] == 'A' && s[i][1] == 'C' )
                {
                    if( a > c )
                    {
                        a--;
                        c++;
                        ans.pb('C');
                    }
                    else if ( a < c )
                    {
                        a++;
                        c--;
                        ans.pb('A');
                    }
                    else
                    {
                        if ( i+1 != s.size() )
                        {
                            if ( s[i+1][0] == 'A' && s[i+1][1] == 'B' )
                            {
                                a++;
                                c--;
                                ans.pb('A');
                                if ( c < 0 )
                                {
                                    ok = false;
                                    break;
                                }
                            }
                            else if ( s[i+1][0] == 'A' && s[i+1][1] == 'C' )
                            {
                                a++;
                                c--;
                                ans.pb('A');
                                if( c < 0 )
                                {
                                    ok = false;
                                    break;
                                }
                            }
                            else
                            {
                                c++;
                                a--;
                                ans.pb('C');
                                if ( a < 0 )
                                {
                                    ok = false;
                                    break;
                                }
                            } 
                        }
                        else
                        {
                            a--;
                            c++;
                            ans.pb('C');
                            if ( a < 0 )
                            {
                                ok = false;
                                break;
                            } 
                        }
                    }
                }
                else
                {
                   if( b > c )
                    {
                        b--;
                        c++;
                        ans.pb('C');
                    }
                    else if ( b < c )
                    {
                        b++;
                        c--;
                        ans.pb('B');
                    }
                    else
                    {
                        if ( i+1 != s.size() )
                        {
                            if ( s[i+1][0] == 'A' && s[i+1][1] == 'B' )
                            {
                                b++;
                                c--;
                                ans.pb('B');
                                if ( c < 0 )
                                {
                                    ok = false;
                                    break;
                                }
                            }
                            else if ( s[i+1][0] == 'A' && s[i+1][1] == 'C' )
                            {
                                b--;
                                c++;
                                ans.pb('C');
                                if ( b < 0 )
                                {
                                    ok = false;
                                    break;
                                }
                            }
                            else
                            {
                                c++;
                                b--;
                                ans.pb('C');
                                if ( b < 0 )
                                {
                                    ok = false;
                                    break;
                                }
                            } 
                        }
                        else
                        {
                            b--;
                            c++;
                            ans.pb('C');
                            if ( b < 0 )
                            {
                                ok = false;
                                break;
                            }
                        }
                    }
                }
            }
            else
            {
                if ( s[i][0] == 'A' && s[i][1] == 'B' )
                {
                    if ( a > b )
                    {
                        a--;
                        b++;
                        ans.pb('B');
                    }
                    else
                    {
                        a++;
                        b--;
                        ans.pb('A');
                        if ( b < 0 )
                        {
                            ok = false;
                            break;
                        }
                    }
                    
                }
                else if ( s[i][0] == 'A' && s[i][1] == 'C' )
                {
                    if ( a > c )
                    {
                        a--;
                        c++;
                        ans.pb('C');
                    }
                    else
                    {
                        c--;
                        a++;
                        ans.pb('A');
                        if ( c < 0 )
                        {
                            ok = false;
                            break;
                        }
                    }
                }
                else
                {
                    if ( b > c )
                    {
                        b--;
                        c++;
                        ans.pb('C');
                    }
                    else
                    {
                        b++;
                        c--;
                        ans.pb('B');
                        if ( c < 0 )
                        {
                            ok = false;
                            break;
                        }
                    }
                }
            }
            
        }   
    }

    if (!ok)
    {
        cout<<"No"<<endl;
    }
    else
    {
        cout<<"Yes"<<endl;
        rep(i,0,ans.size())
        {
            cout<<ans[i]<<endl;
        }
    }
    
}

//END OF CODE ->->->->->->->->

signed main()
{
    fast;
    int t = 1;
    // cin>>t;

    while(t--)
    {
        solve();
    }
    return 0;
}



Measured memory_bytes: 6628