#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#define int long long
#define pb push_back
#define x first
#define y second
#define mk(a,b) make_pair(a,b)
#define rr return 0
#define sqr(a) ((a)*(a))
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class value, class cmp = less<value> >
using ordered_set = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class value, class cmp = less_equal<value> >
using ordered_multiset = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class key, class value, class cmp = less<key> >
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

/// find_by_order()
/// order_of_key()
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int randll(int l = INT_MIN, int r = INT_MAX) {
    return uniform_int_distribution<int>(l, r)(rng);
}
const int INF = 1e9, MOD = 1e9 + 7; /// think
const ll LINF = 1e18;


const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
inline bool inside (int x, int y, int n, int m) {
    return 0 <= x && 0 <= y && x < n && y < m;
}

template<class T> bool umin (T &a, T b) {return a > b ? (a = b, true) : false; }
template<class T> bool umax (T &a, T b) {return a < b ? (a = b, true) : false; }



main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, a[3];
    cin >> n >> a[0] >> a[1] >> a[2];
    vector <string> s(n);
    for (auto &i : s) cin >> i;
    umin(a[0], 2);
    umin(a[1], 2);
    umin(a[2], 2);
    bool dp[n + 1][4][4][4] = {};
    tuple <int, int, int> to[n + 1][4][4][4];
    char l[n + 1][4][4][4];
    dp[0][a[0]][a[1]][a[2]] = 1;
    for (int i = 0; i < n; i++) {
        for (int i1 = 0; i1 < 4; i1++) {
            for (int i2 = 0; i2 < 4; i2++) {
                for (int i3 = 0; i3 < 4; i3++) {
                    if (!dp[i][i1][i2][i3]) continue;
                    if (s[i] == "AB") {
                        if (i1 + 1 < 4 && i2 - 1 >= 0) {
                            dp[i + 1][i1 + 1][i2 - 1][i3] = 1;
                            to[i + 1][i1 + 1][i2 - 1][i3] = tuple<int, int, int>{i1, i2, i3};
                            l[i + 1][i1 + 1][i2 - 1][i3] = 'A';
                        }
                        if (i1 - 1 >= 0 && i2 + 1 < 4) {
                            dp[i + 1][i1 - 1][i2 + 1][i3] = 1;
                            to[i + 1][i1 - 1][i2 + 1][i3] = tuple<int, int, int>{i1, i2, i3};
                            l[i + 1][i1 - 1][i2 + 1][i3] = 'B';
                        }
                    }
                    if (s[i] == "AC") {
                        if (i1 + 1 < 4 && i3 - 1 >= 0) {
                            dp[i + 1][i1 + 1][i2][i3 - 1] = 1;
                            to[i + 1][i1 + 1][i2][i3 - 1] = tuple<int, int, int>{i1, i2, i3};
                            l[i + 1][i1 + 1][i2][i3 - 1] = 'A';
                        }
                        if (i1 - 1 >= 0 && i3 + 1 < 4) {
                            dp[i + 1][i1 - 1][i2][i3 + 1] = 1;
                            to[i + 1][i1 - 1][i2][i3 + 1] = tuple<int, int, int>{i1, i2, i3};
                            l[i + 1][i1 - 1][i2][i3 + 1] = 'C';
                        }
                    }
                    if (s[i] == "BC") {
                        if (i2 + 1 < 4 && i3 - 1 >= 0) {
                            dp[i + 1][i1][i2 + 1][i3 - 1] = 1;
                            to[i + 1][i1][i2 + 1][i3 - 1] = tuple<int, int, int>{i1, i2, i3};
                            l[i + 1][i1][i2 + 1][i3 - 1] = 'B';
                        }
                        if (i2 - 1 >= 0 && i3 + 1 < 4) {
                            dp[i + 1][i1][i2 - 1][i3 + 1] = 1;
                            to[i + 1][i1][i2 - 1][i3 + 1] = tuple<int, int, int>{i1, i2, i3};
                            l[i + 1][i1][i2 - 1][i3 + 1] = 'C';
                        }
                    }
                }
            }
        }
    }
    bool ans = false;
    int x1, x2, x3;
    for (int i1 = 0; i1 < 4; i1++) {
        for (int i2 = 0; i2 < 4; i2++) {
            for (int i3 = 0; i3 < 4; i3++) {
                if (dp[n][i1][i2][i3]) {
                    x1 = i1;
                    x2 = i2;
                    x3 = i3;
                    ans = true;
                }
            }
        }
    }
    if (!ans) {
        cout << "No\n";
        rr;
    }
    cout << "Yes\n";
    vector <char> res;
    for (int i = 0; i < n; i++) {
        res.pb(l[n - i][x1][x2][x3]);
        tie(x1, x2, x3) = to[n - i][x1][x2][x3];
    }
    reverse(all(res));
    for (auto &i : res) {
        cout << i << '\n';
    }
}


Measured memory_bytes: 94244