#include <bits/stdc++.h>
using namespace std;

int main()
{
    int N, A, B, C;
    cin >> N >> A >> B >> C;
    vector<int> abc = {A, B, C};

    vector<string> s(N);
    for (int i = 0; i < N; i++)
    {
        cin >> s.at(i);
    }

    vector<int> res(N);
    for (int i = 0; i < N; i++)
    {
        int x, y;
        if (s.at(i) == "AB")
        {
            x = 0;
            y = 1;
        }
        else if (s.at(i) == "AC")
        {
            x = 0;
            y = 2;
        }
        else
        {
            x = 1;
            y = 2;
        }

        if (abc.at(x) == 0 && abc.at(y) == 0)
        {
            cout << "No" << endl;
            return 0;
        }
        else if (abc.at(x) == 0)
        {
            res.at(i) = x;
            abc.at(x) += 1;
            abc.at(y) -= 1;
        }
        else if (abc.at(y) == 0)
        {
            res.at(i) = y;
            abc.at(x) -= 1;
            abc.at(y) += 1;
        }
        else if (abc.at(x) == 1 && abc.at(y) == 1)
        {
            if (i + 1 < N)
            {
                if (s.at(i) == "AB" && s.at(i + 1) == "AC")
                {
                    res.at(i) = 0;
                    abc.at(0) += 1;
                    abc.at(1) -= 1;
                }
                else if (s.at(i) == "AB" && s.at(i + 1) == "BC")
                {
                    res.at(i) = 1;
                    abc.at(1) += 1;
                    abc.at(0) -= 1;
                }
                else if (s.at(i) == "BC" && s.at(i + 1) == "AB")
                {
                    res.at(i) = 1;
                    abc.at(1) += 1;
                    abc.at(2) -= 1;
                }
                else if (s.at(i) == "BC" && s.at(i + 1) == "AC")
                {
                    res.at(i) = 2;
                    abc.at(2) += 1;
                    abc.at(1) -= 1;
                }
                else if (s.at(i) == "AC" && s.at(i + 1) == "AB")
                {
                    res.at(i) = 0;
                    abc.at(0) += 1;
                    abc.at(2) -= 1;
                }
                else if (s.at(i) == "AC" && s.at(i + 1) == "BC")
                {
                    res.at(i) = 2;
                    abc.at(2) += 1;
                    abc.at(0) -= 1;
                }
                else
                {
                    res.at(i) = x;
                    abc.at(x) += 1;
                    abc.at(y) -= 1;
                }
            }
            else
            {
                res.at(i) = x;
                abc.at(x) += 1;
                abc.at(y) -= 1;
            }
        }
        else
        {
            if (abc.at(x) < abc.at(y))
            {
                res.at(i) = x;
                abc.at(x) += 1;
                abc.at(y) -= 1;
            }
            else
            {
                res.at(i) = y;
                abc.at(y) += 1;
                abc.at(x) -= 1;
            }
        }
    }
    cout << "Yes" << endl;
    for (int i = 0; i < N; i++)
    {
        if (res.at(i) == 0)
        {
            cout << "A" << endl;
        }
        else if (res.at(i) == 1)
        {
            cout << "B" << endl;
        }
        else
        {
            cout << "C" << endl;
        }
    }
}

Measured memory_bytes: 6692