/*!enjoy karo yaar!*/

//CF,CC,AtC,SPOJ: hp1999
//HE: hemant269
//HR: hemant2132

#include<bits/stdc++.h>
using namespace std;

//#define     int             long long int
#define     fast()          ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define     all(x)          (x).begin(),(x).end()
#define     rz(x)           resize(x)
#define     mem(a,b)        memset(a,b,sizeof(a))
#define     sz(x)           ((int)(x.size()))
#define     eb              emplace_back
#define     pb              push_back
#define     pf              push_front
#define     pob             pop_back
#define     pof             pop_front
#define     ins             insert
#define     vi              vector<int>
#define     pii             pair<int,int>
#define     mii             map<int,int>
#define     F               first
#define     S               second
#define     makep           make_pair
#define     maket           make_tuple
#define     remax(a,b)      a=max(a,b)
#define     remin(a,b)      a=min(a,b)
#define     bitcount(x)     __builtin_popcountll(x)
#define     iceil(n,x)      (((n)+(x)-1)/(x))
#define     gcd(a,b)        (__gcd((a),(b)))
#define     lcm(a,b)        (((a)*(b))/gcd((a),(b)))
#define     dbug(x)         cout<<#x<<": "<<(x)<<"\n"
#define     flush           fflush(stdout)
#define     show(x)         for(auto zz:x)cout<<zz<<" ";cout<<"\n";
#define     show2(x)        for(auto zz:x)cout<<zz.F<<" "<<zz.S<<"\n";

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

const ld pi=acos(-1);
const ll inf=1e18,M=1e9+7;
const int N=1e5+5;

bool dp[N][3][3][3];
bool mark[N][3][3][3];
int nxt[N][3][3][3];

vector<string> s;
int n;

bool rec(int ind,int a,int b,int c)
{
    if(a<0 || b<0 || c<0)
        return 0;

    if(ind==n)
    {
        if(a>=0 && b>=0 && c>=0)
            return 1;

        return 0;
    }

    if(mark[ind][a][b][c])
        return dp[ind][a][b][c];

    mark[ind][a][b][c]=1;

    bool res=0;

    if(s[ind]=="AB")
    {
        if(rec(ind+1,a+1,b-1,c))
            res=1,nxt[ind][a][b][c]=1;
        else if(rec(ind+1,a-1,b+1,c))
            res=1,nxt[ind][a][b][c]=2;
    }

    else if(s[ind]=="AC")
    {
        if(rec(ind+1,a+1,b,c-1))
            res=1,nxt[ind][a][b][c]=1;
        else if(rec(ind+1,a-1,b,c+1))
            res=1,nxt[ind][a][b][c]=3;
    }

    else if(s[ind]=="BC")
    {
        if(rec(ind+1,a,b+1,c-1))
            res=1,nxt[ind][a][b][c]=2;
        else if(rec(ind+1,a,b-1,c+1))
            res=1,nxt[ind][a][b][c]=3;
    }

    dp[ind][a][b][c]=res;

    return res;
}

void solve()
{
    mem(dp,0);
    mem(mark,0);
    mem(nxt,0);

    int a,b,c;
    cin>>n>>a>>b>>c;

    s.rz(n);
    for(int i=0;i<n;++i)
        cin>>s[i];

    int sum=a+b+c;

    if(sum==0)
    {
        cout<<"No";
        return;
    }

    if(((a && b) || (b && c) || (a && c)) && sum>=3)
    {
        cout<<"Yes\n";

        for(int i=0;i<n;++i)
        {
            if(s[i]=="AB")
            {
                if(a>b)
                {
                    cout<<"B";
                    --a,++b;
                }
                else
                {
                    cout<<"A";
                    ++a,--b;
                }
            }
            else if(s[i]=="AC")
            {
                if(a>c)
                {
                    cout<<"C";
                    --a,++c;
                }
                else
                {
                    cout<<"A";
                    ++a,--c;
                }
            }
            else if(s[i]=="BC")
            {
                if(c>b)
                {
                    cout<<"B";
                    --c,++b;
                }
                else
                {
                    cout<<"C";
                    ++c,--b;
                }
            }

            cout<<"\n";
            //cout<<a<<" "<<b<<" "<<c<<"\n";
        }

        return;
    }

    a=min(a,2);
    b=min(b,2);
    c=min(c,2);

    bool ans=rec(0,a,b,c);

    if(!ans)
    {
        cout<<"No";
        return;
    }

    cout<<"Yes\n";

    int x=0;
    while(x!=n)
    {
        if(nxt[x][a][b][c]==1)
        {
            cout<<"A";

            ++a;
            if(s[x]=="AB")
                --b;
            else
                --c;
        }
        if(nxt[x][a][b][c]==2)
        {
            cout<<"B";

            ++b;
            if(s[x]=="AB")
                --a;
            else
                --c;
        }
        if(nxt[x][a][b][c]==3)
        {
            cout<<"C";

            ++c;
            if(s[x]=="AC")
                --a;
            else
                --b;
        }

        ++x;

        cout<<"\n";
    }
}

int32_t main()
{
    fast();

    int t=1;
    //cin>>t;
    for(int z=1;z<=t;++z)
    {
        solve();
        //cout<<"\n";
    }

    return 0;
}



Measured memory_bytes: 31448