#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=nxt();
    int a=nxt(),b=nxt(),c=nxt();
    vector <char> ans;
    vector <string> temp;
    while(n--)
    {
        string s;
        cin>>s;
        if(s=="AC")
        {
            if(a==0&&c==0)
            {
                bool f=0;
                if(temp.size())
                {
                    string s2=temp[temp.size()-1];
                    if(s2=="AB"&&b==2||s2=="BC"&&b==2)
                    {f=1;
                        ans.pop_back();
                        if(s2=="AB"){
                            ans.push_back('A');
                            a=2;
                        }
                        else{
                            ans.push_back('C');
                            c=2;
                        }
                        b=0;
                    }
                }
                if(!f){
                cout<<"No\n";
                return 0;}
            }
            if(a>=c)
            {
                a--;
                c++;
                ans.push_back('C');
            }
            else
            {
                a++;
                c--;
                ans.push_back('A');
            }
        }
        else if(s=="AB")
        {
            if(a==0&&b==0)
            {
                bool f=0;
                if(temp.size())
                {
                    string s2=temp[temp.size()-1];
                    if(s2=="AC"&&c==2||s2=="BC"&&c==2)
                    {f=1;
                        ans.pop_back();
                        if(s2=="AC"){
                            ans.push_back('A');
                            a=2;
                        }
                        else{
                            ans.push_back('B');
                            b=2;
                        }
                        c=0;
                    }
                }
                if(!f){
                cout<<"No\n";
                return 0;}
            }
            if(a>=b)
            {
                a--;
                b++;
                ans.push_back('B');
            }
            else
            {
                a++;
                b--;
                ans.push_back('A');
            }
        }
        else
        {
            if(b==0&&c==0)
            {
                bool f=0;
                if(temp.size())
                {
                    string s2=temp[temp.size()-1];
                    if(s2=="AB"&&a==2||s2=="AC"&&a==2)
                    {f=1;
                        ans.pop_back();
                        if(s2=="AB"){
                            ans.push_back('B');
                            b=2;
                        }
                        else{
                            ans.push_back('C');
                            c=2;
                        }
                        a=0;
                    }
                }
                if(!f){
                cout<<"No\n";
                return 0;}
            }
            if(b>=c)
            {
                b--;
                c++;
                ans.push_back('C');
            }
            else
            {
                b++;
                c--;
                ans.push_back('B');
            }
        }
        temp.push_back(s);
    }
    cout<<"Yes\n";
    for(auto i:ans)
        cout<<i<<endl;
    
    
    return 0;   
}




 
 


Measured memory_bytes: 7444