// AtCoder Beginner Contest 166 - Problem F: Three Variables Game (https://atcoder.jp/contests/abc166/tasks/abc166_f)  
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii = pair<int, int>;

const int MAX { 3 }, MAXN { 100010 };
const ll MOD { 1000000007 }, oo { 1LL << 62 };

struct Prev { int a, b, c; char p; };

int st[MAX][MAX][MAX][MAXN];   // st[a][b][c][i] - é possível resolver com i movimentos para
                               // valores a, b, c? -1 indica estado não computado

Prev ps[MAX][MAX][MAX][MAXN];   // ps[a][b][c][i] - comando a ser utilizado para que o estado
                                // tenha solução


string get_path(int a, int b, int c, int N)
{
    string path;

    for (int i = N; i >= 1; --i)
    {
        auto p = ps[a][b][c][i];
#ifdef DEBUG
cout << "=== a = " << a << ", b = " << b << ", c = " << c << ", i = " << i << endl;
cout << "    p = (" << p.a << ", " << p.b << ", " << p.c << ", " << p.p << endl;
#endif
        path.push_back(p.p);
        a = p.a;
        b = p.b;
        c = p.c;
    }

    reverse(path.begin(), path.end());
 
    return path;
}

string solve(int N, int A, int B, int C, const vector<string>& xs)
{
    int a = min(A, 2), b = min(B, 2), c = min(C, 2);
    memset(st, 0, sizeof st);

#ifdef DEBUG
cout << "a = " << a << ", b = " << b << ", c = " << c << endl;
#endif
    st[a][b][c][0] = 1;

    for (int i = 1; i <= N; ++i)
        for (int x = 0; x <= 2; ++x)
            for (int y = 0; y <= 2; ++y)
                for (int z = 0; z <= 2; ++z)
                { 
                    if (st[x][y][z][i - 1] == 0)
                        continue;
#ifdef DEBUG
cout << "x = " << x << ", y = " << y << ", z = " << z << endl;
#endif
                    if (xs[i] == "AB")
                    {
                        if (x > 0)
                        {
                            st[x - 1][min(y + 1, 2)][z][i] = 1;
                            ps[x - 1][min(y + 1, 2)][z][i] = Prev { x, y, z, 'B' };
                        }

                        if (y > 0)
                        {
                            st[min(x + 1, 2)][y - 1][z][i] = 1;
                            ps[min(x + 1, 2)][y - 1][z][i] = Prev { x, y, z, 'A' };
                        }
                    } else if (xs[i] == "AC")
                    {
                        if (x > 0)
                        {
                            st[x - 1][y][min(z + 1, 2)][i] = 1;
                            ps[x - 1][y][min(z + 1, 2)][i] = Prev { x, y, z, 'C' };
                        }

                        if (z > 0)
                        {
                            st[min(x + 1, 2)][y][z - 1][i] = 1;
                            ps[min(x + 1, 2)][y][z - 1][i] = Prev { x, y, z, 'A' };
                        }
                    } else 
                    {
                        if (y > 0)
                        {
                            st[x][y - 1][min(z + 1, 2)][i] = 1;
                            ps[x][y - 1][min(z + 1, 2)][i] = Prev { x, y, z, 'C' };
                        }

                        if (z > 0)
                        {
                            st[x][min(y + 1, 2)][z - 1][i] = 1;
                            ps[x][min(y + 1, 2)][z - 1][i] = Prev { x, y, z, 'B' };
                        }
                    }
                }

    string ans;

    for (int x = 0; x <= 2; ++x)
        for (int y = 0; y <= 2; ++y)
            for (int z = 0; z <= 2; ++z)
            {
#ifdef DEBUG
    cout << "st[" << x << "][" << y << "][" << z << "][" << N << "] = " << st[x][y][z][N] << endl;
#endif
                if (st[x][y][z][N]) 
                {
                    a = x;
                    b = y;
                    c = z;
                    ans = get_path(a, b, c, N);
#ifdef DEBUG
    cout << "--- sol: a = " << a << ", b = " << b << ", c = " << c << endl;
    cout << "    path = " << ans << endl;
#endif
                }
            }

    return ans;
}

int main()
{
    ios::sync_with_stdio(false);

    int N, A, B, C;
    cin >> N >> A >> B >> C;

    vector<string> xs(N + 1);

    for (int i = 1; i <= N; ++i)
        cin >> xs[i];

    auto ans = solve(N, A, B, C, xs);

    if (not ans.empty())
    {
        cout << "Yes\n";

        for (auto c : ans)
            cout << c << endl;
    } else
        cout << "No" << '\n';

    return 0;
}


Measured memory_bytes: 47080