#include <bits/stdc++.h>
using namespace std;
//using Graph = vector<vector<int>>;
using P = pair<int,int>;
//int dy[4] = {-1,0,1,0};
//int dx[4] = {0,-1,0,1};


int main()
{
    int N;
    cin >> N;
    int A,B,C;
    cin >> A >> B >> C;
    
    vector<char> data(N);
    vector<int> use(3,0);
    
    
    vector<string> s(N);
    for(int i=0;i<N;i++)
    {
        cin >> s[i];
        if(s[i] == "AB")
        {
            use[0]++;
            use[1]++;
            
        }
        else if(s[i] == "AC")
        {
            use[0]++;
            use[2]++;
        }
        else
        {
            use[1]++;
            use[2]++;
        }
    }
    for(int i=0;i<N;i++)
    {
        if(s[i] == "AB")
        {
            use[0]--;
            use[1]--;
            if(A>B)
            {
                data[i] = 'B';
                A--;
                B++;
            }
            else if(A<B)
            {
                data[i] = 'A';
                A++;
                B--;
            }
            else
            {
                
                    if(i != N-1 && s[i+1] == "AC")
                    {
                        data[i] = 'A';
                        A++;
                        B--;
                    }
                    else
                    {
                        data[i] = 'B';
                        A--;
                        B++;
                    }
                
            }
        }
        else if(s[i] == "AC")
        {
            use[0]--;
            use[2]--;
            if(A>C)
            {
                data[i] = 'C';
                A--;
                C++;
            }
            else if(A<C)
            {
                data[i] = 'A';
                A++;
                C--;
            }
            else
            {
                
                    if(i != N-1 && s[i+1] == "AB")
                    {
                        data[i] = 'A';
                        A++;
                        C--;
                    }
                    else
                    {
                        data[i] = 'C';
                        A--;
                        C++;
                    }
                
            }
        }
        else
        {
            use[2]--;
            use[1]--;
            if(C>B)
            {
                data[i] = 'B';
                C--;
                B++;
            }
            else if(C<B)
            {
                data[i] = 'C';
                C++;
                B--;
            }
            else
            {
                
                    if(i != N-1 && s[i+1] == "AC")
                    {
                        data[i] = 'C';
                        C++;
                        B--;
                    }
                    else
                    {
                        data[i] = 'B';
                        C--;
                        B++;
                    }
                
            }
        }
        if(A == -1 || B==-1 || C==-1)
        {
            cout << "No" << endl;
            return 0;
        }
    }
    
    cout << "Yes" << endl;
    
    for(int i=0;i<N;i++)
    {
        cout << data[i] << endl;
    }
    
    
    return 0;
}


/*
int main()
{
    int N;
    cin >> N;
    
    
    return 0;
}
*/

Measured memory_bytes: 6428