#include <bits/stdc++.h>

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define REPV(iter, v) for(auto (iter)=(v).begin(); (iter)!=(v).end();++(iter))
#define ALL(v) (v).begin(),(v).end()

#define MOD 1000000007

using namespace std;

typedef long long ll;

int main()
{
    ll N, A, B, C;
    cin >> N >> A >> B >> C;
    vector<string> s(N);
    bool flagAB = false, flagAC = false, flagBC = false;
    REP(i, N) 
    {
        cin >> s[i];
    }

    string ansS = "";
    REP(i, N)
    {
        if (s[i] == "AB")
        {
            if (A == 0 && B == 0) 
            {
                break;
            }
            if (A == 1 && B == 1 && C == 0)
            {
                if (i + 1 < N)
                {
                    if (s[i + 1] == "AC")
                    {
                        A++;
                        B--;
                        ansS.push_back('A');
                        continue;
                    }
                    else if (s[i + 1] == "BC")
                    {
                        A--;
                        B++;
                        ansS.push_back('B');
                        continue;
                    }
                }
            }
            if (A >= B)
            {
                A--;
                B++;
                ansS.push_back('B');

            }
            else
            {
                A++;
                B--;
                ansS.push_back('A');
            }
        }
        else if (s[i] == "AC")
        {
            if (A == 0 && C == 0) 
            {
                break;
            }
            if (A == 1 && B == 0 && C == 1)
            {
                if (i + 1 < N)
                {
                    if (s[i + 1] == "AB")
                    {
                        A++;
                        C--;
                        ansS.push_back('A');
                        continue;
                    }
                    else if (s[i + 1] == "BC")
                    {
                        A--;
                        C++;
                        ansS.push_back('C');
                        continue;
                    }
                }
            }
            if (A >= C)
            {
                A--;
                C++;
                ansS.push_back('C');
            }
            else
            {
                A++;
                C--;
                ansS.push_back('A');
            }
        }
        else if (s[i] == "BC")
        {
            if (B == 0 && C == 0) 
            {
                break;
            }
            if (A == 0 && B == 1 && C == 1)
            {
                if (i + 1 < N)
                {
                    if (s[i + 1] == "AB")
                    {
                        B++;
                        C--;
                        ansS.push_back('B');
                        continue;
                    }
                    else if (s[i + 1] == "AC")
                    {
                        B--;
                        C++;
                        ansS.push_back('C');
                        continue;
                    }
                }
            }
            if (B >= C)
            {
                B--;
                C++;
                ansS.push_back('C');
            }
            else
            {
                B++;
                C--;
                ansS.push_back('B');
            }
        }
    }

    if (ansS.size() != N)
    {
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
        REP(i, N) cout << ansS[i] << endl;
    }
    
}


Measured memory_bytes: 6700