#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

template <class T, class U>
vector<T> make_v(U size, const T& init){ return vector<T>(static_cast<size_t>(size), init); }

template<class... Ts, class U>
auto make_v(U size, Ts... rest) { return vector<decltype(make_v(rest...))>(static_cast<size_t>(size), make_v(rest...)); }

template<class T> void chmin(T &a, const T &b){ a = (a < b ? a : b); }
template<class T> void chmax(T &a, const T &b){ a = (a > b ? a : b); }

int main() {
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    vector<string> que(n);
    for (auto &&i : que) cin >> i;
    auto dp = make_v(n+1, 5, 5, 5, false);
    auto from = make_v(n+1, 5, 5, 5, 0);
    dp[0][min(a, 4)][min(b, 4)][min(c, 4)] = true;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < 5; ++j) {
            for (int k = 0; k < 5; ++k) {
                for (int l = 0; l < 5; ++l) {
                    if(!dp[i][j][k][l]) continue;
                    if(que[i] == "AB"){
                        if(k) {
                            dp[i+1][min(4, j+1)][k-1][l] = 1;
                            from[i+1][min(4, j+1)][k-1][l] = j + (k << 3) + (l << 6);
                        }
                        if(j) {
                            dp[i+1][j-1][min(4, k+1)][l] = 1;
                            from[i+1][j-1][min(4, k+1)][l] = j + (k << 3) + (l << 6);
                        }
                    }else if(que[i] == "AC"){
                        if(l) {
                            dp[i+1][min(4, j+1)][k][l-1] = 1;
                            from[i+1][min(4, j+1)][k][l-1] = j + (k << 3) + (l << 6);
                        }
                        if(j) {
                            dp[i+1][j-1][k][min(4, l+1)] = 1;
                            from[i+1][j-1][k][min(4, l+1)] = j + (k << 3) + (l << 6);
                        }
                    }else if(que[i] == "BC"){
                        if(l) {
                            dp[i+1][j][min(4, k+1)][l-1] = 1;
                            from[i+1][j][min(4, k+1)][l-1] = j + (k << 3) + (l << 6);
                        }
                        if(k) {
                            dp[i+1][j][k-1][min(4, l+1)] = 1;
                            from[i+1][j][k-1][min(4, l+1)] = j + (k << 3) + (l << 6);
                        }
                    }
                }
            }
        }
    }
    a = -1, b = -1, c = -1;
    for (int j = 0; j < 5; ++j) {
        for (int k = 0; k < 5; ++k) {
            for (int l = 0; l < 5; ++l) {
                if(dp.back()[j][k][l] == 1){
                    a = j, b = k, c = l;
                }
            }
        }
    }
    if(!~a) {
        puts("No");
        return 0;
    }
    puts("Yes");
    vector<char> ans(n);
    for (int i = n-1; i >= 0; --i) {
        int val = from[i+1][a][b][c];
        int aa = val&7, bb = (val >> 3)&7, cc = (val >> 6)&7;
        if(que[i] == "AB"){
            if(aa > a) ans[i] = 'B';
            else ans[i] = 'A';
        }else if(que[i] == "BC"){
            if(bb > b) ans[i] = 'C';
            else ans[i] = 'B';
        }else if(que[i] == "AC"){
            if(cc > c) ans[i] = 'A';
            else ans[i] = 'C';
        }
        a = aa; b = bb; c = cc;
    }
    for (auto &&m : ans) {
        cout << m << "\n";
    }
    return 0;
}

Measured memory_bytes: 356616