#pragma GCC optimize("O3")
#pragma GCC optimize("O1")
#pragma GCC optimize("O2")
#pragma GCC optimize("Os")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);
#define FO cout.tie(NULL);
#define FI cin.tie(NULL);
#define IN cin>>
#define OUT cout<<
#define loop(i,a,n) for(ll i=a; i<n; i++)
#define rloop(i,a,n) for(int i=a; i>=n; i--)
#define endl "\n";
#define pb push_back
#define mp make_pair
#define set_bits(a) __builtin_popcountll(a)
#define ll long long int
#define ld long double
#define vll vector<long long int>
#define pll pair<long long int, long long int>
#define mod 1000000007
#define M 998244353
ll gcd(ll a, ll b)
{
    return (b?gcd(b,a%b):a);
}
ll P(ll B, ll power, ll modulo)
{
    ll ans=1LL;
    while(power>0LL)
    {
        if(power%2LL==1LL)
        {
            ans=(ans*B)%modulo;
        }
        B=(B*B)%modulo;
        power/=2LL;
    }
    return ans;
}
bool isPrime(ll n)
{
    if(n<=1LL)
    {
        return false;
    }
    if(n<=3LL)
    {
        return true;
    }
    if(n%2==0LL || n%3==0LL)
    {
        return false;
    }
    for(ll i=5LL; (i*i)<=n; i+=6LL)
    {
        if(n%i==0LL || n%(i+2LL)==0LL)
        {
            return false;
        }
    }
    return true;
}
using namespace std;
bool sortbysec(const pair<pair<int,int>,int> &a, const pair<pair<int,int>,int> &b)
{
    return (a.first.second<b.first.second);
}
bool sortbysecll(const pll &a, const pll &b)
{
    return (a.second<b.second);
}
ll modinv(ll x, ll y, ll modulo)
{
    return ((x%modulo)*(P(y,modulo-2LL,modulo)%modulo))%modulo;
}
void vok()
{
    FAST
    FO
    FI
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
}
int main()
{
    vok();
    int n,a,b,c;
    IN n>>a>>b>>c;
    vector<string> s(n);
    loop(i,0,n)
    {
        IN s[i];
    }
    vector<char> ans(n);
    loop(i,0,n)
    {
        if(s[i]=="AB")
        {
            if(a==0 && b==0)
            {
                OUT "No"<<endl
                return 0;
            }
            if(a>b)
            {
                a--;
                b++;
                ans[i]='B';
            }
            else if(a<b)
            {
                a++;
                b--;
                ans[i]='A';
            }
            else
            {
                if(s[i+1]=="BC" && i+1<n)
                {
                    a--;
                    b++,
                    ans[i]='B';
                }
                else
                {
                    a++;
                    b--;
                    ans[i]='A';
                }
            }
        }
        if(s[i]=="BC")
        {
            if(c==0 &&b ==0)
            {
                OUT "No"<<endl
                return 0;
            }
            if(c>b)
            {
                c--;
                b++;
                ans[i]='B';
            }
            else if(c<b)
            {
                c++;
                b--;
                ans[i]='C';
            }
            else
            {
                if(s[i+1]=="AB" && i+1<n)
                {
                    c--;
                    b++;
                    ans[i]='B';
                }
                else
                {
                    c++;
                    b--;
                    ans[i]='C';
                }
            }
        }
        if(s[i]=="AC")
        {
            if(a==0 && c==0)
            {
                OUT "No"<<endl
                return 0;
            }
            if(a>c)
            {
                a--;
                c++;
                ans[i]='C';
            }
            else if(a<c)
            {
                a++;
                c--;
                ans[i]='A';
            }
            else
            {
                if(s[i+1]=="BC" && i+1<n)
                {
                    a--;
                    c++;
                    ans[i]='C';
                }
                else
                {
                    a++;
                    c--;
                    ans[i]='A';
                }
            }
        }
    }
    OUT "Yes"<<endl
    for(auto x:ans)
    {
        OUT x<<endl
    }
    return 0;
}

Measured memory_bytes: 6664