#include <cstdio>
#include <cmath>
#include <limits>
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <numeric> // 最大公約数が使える
#define rep(i, s, g) for (i = s; i < g; i++)
using namespace std;
using ll = long long;
const int inf = 1000000000; //10^9

int main()
{
    ll N, A, B, C;
    cin >> N >> A >> B >> C;
    vector<string> S(N);
    vector<char> ans(N);
    for (int i = 0; i < N; i++)
    {
        cin >> S[i];
    }

    for (int i = 0; i < N; i++)
    {

        if (S[i] == "AB")
        {
            if (A == 0 && B == 0)
            {
                cout << "No" << endl;
                return 0;
            }
            if (A > B)
            {
                A--;
                B++;
                ans[i] = 'B';
            }
            else if (A == B)
            {
                if (i == N - 1)
                {
                    ans[i] = 'A';
                }
                else
                {
                    if (S[i + 1] == "AC")
                    {
                        A++;
                        B--;
                        ans[i] = 'A';
                    }
                    else if (S[i + 1] == "BC" || S[i + 1] == "AB")
                    {
                        B++;
                        A--;
                        ans[i] = 'B';
                    }
                }
            }
            else
            {
                A++;
                B--;
                ans[i] = 'A';
            }
        }

        else if (S[i] == "AC")
        {
            if (A == 0 && C == 0)
            {
                cout << "No" << endl;
                return 0;
            }
            if (A > C)
            {
                A--;
                C++;
                ans[i] = 'C';
            }
            else if (A == C)
            {
                if (i == N - 1)
                {
                    ans[i] = 'A';
                }
                else
                {
                    if (S[i + 1] == "AB")
                    {
                        A++;
                        C--;
                        ans[i] = 'A';
                    }
                    else if (S[i + 1] == "BC" || S[i + 1] == "AC")
                    {
                        C++;
                        A--;
                        ans[i] = 'C';
                    }
                }
            }
            else
            {
                A++;
                C--;
                ans[i] = 'A';
            }
        }

        else if (S[i] == "BC")
        {
            if (B == 0 && C == 0)
            {
                cout << "No" << endl;
                return 0;
            }
            if (C > B)
            {
                C--;
                B++;
                ans[i] = 'B';
            }
            else if (C == B)
            {
                if (i == N - 1)
                {
                    ans[i] = 'C';
                }
                else
                {
                    if (S[i + 1] == "AB")
                    {
                        B++;
                        C--;
                        ans[i] = 'B';
                    }
                    else if (S[i + 1] == "AC" || S[i + 1] == "BC")
                    {
                        C++;
                        B--;
                        ans[i] = 'C';
                    }
                }
            }
            else
            {
                C++;
                B--;
                ans[i] = 'C';
            }
        }
    }
    cout << "Yes" << endl;
    for (auto x : ans)
    {
        cout << x << endl;
    }
}

Measured memory_bytes: 6432