#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(a) (a).begin(), (a).end()
typedef vector<int> vi;
const int INF = 1LL << 58;
const int MOD = 1000000007;
const int MAX_N = 200100;

int func(int *a, int *b)
{
    if (*a == 0 && *b == 0)
        return -1;
    if (*a > *b)
    {
        (*a)--;
        (*b)++;
        return 1;
    }
    else
    {
        (*a)++;
        (*b)--;
        return 0;
    }
}

signed main()
{
    int N;
    cin >> N;
    int A, B, C;
    cin >> A >> B >> C;
    int sum = A + B + C;

    vi v;
    v.resize(N);
    REP(i, N)
    {
        string S;
        cin >> S;
        if (S == "AB")
            v[i] = 0;
        else if (S == "BC")
            v[i] = 1;
        else if (S == "AC")
            v[i] = 2;
    }

    vi ans;
    ans.resize(N);
    if (sum > 2)
    {
        int tmp;
        REP(i, N)
        {
            if (v[i] == 0)
            {
                tmp = func(&A, &B);
                if (tmp == 0)
                    ans[i] = 0;
                else
                    ans[i] = 1;
            }
            else if (v[i] == 1)
            {
                tmp = func(&B, &C);
                if (tmp == 0)
                    ans[i] = 1;
                else
                    ans[i] = 2;
            }
            else if (v[i] == 2)
            {
                tmp = func(&A, &C);
                if (tmp == 0)
                    ans[i] = 0;
                else
                    ans[i] = 2;
            }
            if (tmp == -1)
            {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    else
    {
        int tmp;
        REP(i, N)
        {
            if (v[i] == 0)
            {
                if (A == 1 && B == 1 && i != N - 1)
                {
                    if (v[i + 1] == 2)
                    {
                        A++;
                        B--;
                        ans[i] = 0;
                    }
                    else
                    {
                        A--;
                        B++;
                        ans[i] = 1;
                    }
                }
                else
                {
                    tmp = func(&A, &B);
                    if (tmp == 0)
                        ans[i] = 0;
                    else
                        ans[i] = 1;
                }
            }
            else if (v[i] == 1)
            {
                if (B == 1 && C == 1 && i != N - 1)
                {
                    if (v[i + 1] == 0)
                    {
                        B++;
                        C--;
                        ans[i] = 1;
                    }
                    else
                    {
                        B--;
                        C++;
                        ans[i] = 2;
                    }
                }
                else
                {
                    tmp = func(&B, &C);
                    if (tmp == 0)
                        ans[i] = 1;
                    else
                        ans[i] = 2;
                }
            }
            else if (v[i] == 2)
            {
                if (A == 1 && C == 1 && i != N - 1)
                {
                    if (v[i + 1] == 0)
                    {
                        A++;
                        C--;
                        ans[i] = 0;
                    }
                    else
                    {
                        A--;
                        C++;
                        ans[i] = 2;
                    }
                }
                else
                {
                    tmp = func(&A, &C);
                    if (tmp == 0)
                        ans[i] = 0;
                    else
                        ans[i] = 2;
                }
            }
            if (tmp == -1)
            {
                cout << "No" << endl;
                return 0;
            }
        }
    }

    cout << "Yes" << endl;
    REP(i, N)
    {
        if (ans[i] == 0)
        {
            cout << "A" << endl;
        }
        else if (ans[i] == 1)
        {
            cout << "B" << endl;
        }
        else if (ans[i] == 2)
        {
            cout << "C" << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 4836