#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
constexpr long long MOD = 1e9 + 7;

#define MAX_N 100000
#define MAX 8

bool dp[MAX_N + 1][MAX + 1][MAX + 1][MAX + 1];

signed main() {
    int n;
    ll a, b, c;
    cin >> n >> a >> b >> c;
    string s[n];
    rep(i, n) {
        cin >> s[i];
    }
    a = min(a, 4LL);
    b = min(b, 4LL);
    c = min(c, 4LL);
    dp[0][a][b][c] = true;
    rep(i, n) {
        for (int j = 0; j <= MAX; j++) {
            for (int k = 0; k <= MAX; k++) {
                for (int l = 0; l <= MAX; l++) {
                    if (s[i] == "AB") {
                        if (j - 1 >= 0 && k + 1 <= MAX)
                            dp[i + 1][j][k][l] |= dp[i][j - 1][k + 1][l];
                        if (k - 1 >= 0 && j + 1 <= MAX)
                            dp[i + 1][j][k][l] |= dp[i][j + 1][k - 1][l];
                    } else if (s[i] == "AC") {
                        if (j - 1 >= 0 && l + 1 <= MAX)
                            dp[i + 1][j][k][l] |= dp[i][j - 1][k][l + 1];
                        if (l - 1 >= 0 && j + 1 <= MAX)
                            dp[i + 1][j][k][l] |= dp[i][j + 1][k][l - 1];
                    } else {
                        if (k - 1 >= 0 && l + 1 <= MAX)
                            dp[i + 1][j][k][l] |= dp[i][j][k - 1][l + 1];
                        if (l - 1 >= 0 && k + 1 <= MAX)
                            dp[i + 1][j][k][l] |= dp[i][j][k + 1][l - 1];
                    }
                }
            }
        }
    }
    for (int j = 0; j <= MAX; j++) {
        for (int k = 0; k <= MAX; k++) {
            for (int l = 0; l <= MAX; l++) {
                if (dp[n][j][k][l]) {
                    cout << "Yes" << endl;
                    vector<char> ans;
                    int i = n - 1;
                    while (i >= 0) {
                        if (s[i] == "AB") {
                            if (j - 1 >= 0 && k + 1 <= MAX &&
                                dp[i][j - 1][k + 1][l]) {
                                ans.emplace_back('A');
                                j--;
                                k = min(k + 1, MAX);
                            } else {
                                ans.emplace_back('B');
                                k--;
                                j = j + 1;
                            }
                        } else if (s[i] == "AC") {
                            if (j - 1 >= 0 && l + 1 <= MAX &&
                                dp[i][j - 1][k][l + 1]) {
                                ans.emplace_back('A');
                                j--;
                                l = l + 1;
                            } else {
                                ans.emplace_back('C');
                                l--;
                                j = j + 1;
                            }
                        } else {
                            if (k - 1 >= 0 && l + 1 <= MAX &&
                                dp[i][j][k - 1][l + 1]) {
                                ans.emplace_back('B');
                                k--;
                                l = l + 1;
                            } else {
                                ans.emplace_back('C');
                                l--;
                                k = k + 1;
                            }
                        }
                        i--;
                    }
                    reverse(ALL(ans));
                    for (auto a : ans) {
                        cout << a << endl;
                    }
                    return 0;
                }
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 78076