// #pragma GCC optimize("Ofast,unroll-all-loops")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define all(v) v.begin(), v.end()
#define len(v) ((int)(v).size())
#define pb push_back
#define kek pop_back
#define pii pair<int, int>
#define mp make_pair
#define int ll

#define debug(x) cout << #x << " = " << x << endl;

const int INF = (is_same<int, ll>::value ? 1e18 + 666 : 1e9 + 666);

// const int MEM_SIZE = 1e8;
// char mem[MEM_SIZE];
// int cur_mem_ptr = 0;

// void* operator new(size_t n) {
//     cur_mem_ptr += n;
//     return mem + cur_mem_ptr - n;
// }

// void operator delete(void*) noexcept {}
// void operator delete(void*, size_t) noexcept {}

template<class t1, class t2>
bool cmin(t1 &a, const t2 &b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template<class t1, class t2>
bool cmax(t1 &a, const t2 &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

#ifndef LOCAL
void UseFiles(const string &s) {
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);
}
#else
void UseFiles(const string&) {}
#endif

void run();

signed main() {
    // UseFiles("squads");
    iostream::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    run();
}

const int K = 5;
#define endl '\n'

void run() {
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    cmin(a, K); cmin(b, K); cmin(c, K);

    vector<vector<vector<vector<char>>>> dp(n + 1, vector<vector<vector<char>>>(K + 1, vector<vector<char>>(K + 1, vector<char>(K + 1, 0))));
    vector<vector<vector<vector<array<char, 4>>>>> prv(n + 1, vector<vector<vector<array<char, 4>>>>(K + 1, vector<vector<array<char, 4>>>(K + 1, vector<array<char, 4>>(K + 1))));
    dp[0][a][b][c] = 1;
    vector<string> moves(n);
    for (auto &x : moves) {
        cin >> x;
    }
    for (int i = 0; i < n; ++i) {
        for (int a = 0; a <= K; ++a) {
            for (int b = 0; b <= K; ++b) {
                for (int c = 0; c <= K; ++c) {
                    if (!dp[i][a][b][c]) continue;
                    if (moves[i] == "AB") {
                        if (int B = min(b + 1, K); a > 0 && cmax(dp[i + 1][a - 1][B][c], 1)) {
                            prv[i + 1][a - 1][B][c] = {0, a, b, c};
                        }
                        if (int A = min(a + 1, K); b > 0 && cmax(dp[i + 1][A][b - 1][c], 1)) {
                            prv[i + 1][A][b - 1][c] = {1, a, b, c};
                        }
                    } else if (moves[i] == "AC") {
                        if (int C = min(c + 1, K); a > 0 && cmax(dp[i + 1][a - 1][b][C], 1)) {
                            prv[i + 1][a - 1][b][C] = {0, a, b, c};
                        }
                        if (int A = min(a + 1, K); c > 0 && cmax(dp[i + 1][A][b][c - 1], 1)) {
                            prv[i + 1][A][b][c - 1] = {1, a, b, c};
                        }
                    } else {
                        if (int C = min(c + 1, K); b > 0 && cmax(dp[i + 1][a][b - 1][C], 1)) {
                            prv[i + 1][a][b - 1][min(c + 1, K)] = {0, a, b, c};
                        }
                        if (int B = min(b + 1, K); c > 0 && cmax(dp[i + 1][a][B][c - 1], 1)) {
                            prv[i + 1][a][B][c - 1] = {1, a, b, c};
                        }
                    }
                }
            }
        }
    }
    c = -1;
    for (int i = 0; i <= K; ++i) {
        for (int j = 0; j <= K; ++j) {
            for (int k = 0; k <= K; ++k) {
                if (dp.back()[i][j][k]) {
                    tie(a, b, c) = make_tuple(i, j, k);
                }
            }
        }
    }
    if (c == -1) {
        cout << "No" << endl;
        return;
    }
    cout << "Yes" << endl;
    string ans;
    for (int i = n; i > 0; --i) {
        // cerr << a << " " << b << " " << c << " " << (int)dp[i][a][b][c] << endl;
        auto [idx, A, B, C] = prv[i][a][b][c];
        ans += moves[i - 1][idx ^ 1];
        tie(a, b, c) = make_tuple(A, B, C);
    }
    // cerr << a << " " << b << " " << c << endl;
    reverse(all(ans));
    for (auto &x : ans) {
        cout << x << endl;
    }
}

Measured memory_bytes: 455232