#include <bits/stdc++.h>
using namespace std;

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define itrdebug(x) cerr << #x << " "; for (auto & el : (x)) {cerr << (el) << " ";} cerr << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define debug(x)
#define itrdebug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

void solve(long long N, long long A, long long B, long long C, std::vector<std::string> s){
    vector<vector<vector<vector<bool>>>> dp(4, vector<vector<vector<bool>>>(4, vector<vector<bool>>(4, vector<bool>(N+1, false))));
    auto get = [](ll a) -> int {
        if (a >= 3) return 3;
        if (a >= 2) return 2;
        if (a == 1) return 1;
        return 0;
    };
    dp[get(A)][get(B)][get(C)][0] = true;
    rep(i,1,N+1) {
        rep(a,0,4) rep(b,0,4) rep(c,0,4) {
            if (!dp[a][b][c][i-1]) continue;
            if (s[i-1] == "AB") {
                if (a>0) dp[a-1][min<int>(b+1,3)][c][i] = true;
                if (b>0) dp[min<int>(a+1,3)][b-1][c][i] = true;
            }
            else if (s[i-1] == "BC") {
                if (b>0) dp[a][b-1][min<int>(c+1,3)][i] = true;
                if (c>0) dp[a][min<int>(b+1,3)][c-1][i] = true;
            }
            else if (s[i-1] == "AC") {
                if (a>0) dp[a-1][b][min<int>(c+1,3)][i] = true;
                if (c>0) dp[min<int>(a+1,3)][b][c-1][i] = true;
            }
        }
    }
    int a, b, c;
    bool isValid = false;
    rep(_a,0,4) rep(_b,0,4) rep(_c,0,4) {
        if (dp[_a][_b][_c][N]) {
            a = _a; b = _b; c = _c;
            isValid = true;
            break;
        }
    }
    if (!isValid) {
        cout << "No" << endl;
        return;
    }
    vector<char> answer(N);
    rrep(i,1,N+1) {
        if (s[i-1] == "AB") {
            if (a>0 && dp[a-1][min<int>(b+1,3)][c][i-1]) {
                a = a-1;
                b = min<int>(b+1,3);
                answer[i-1] = 'A';
            } else if (a==3 && dp[a][min<int>(b+1,3)][c][i-1]) {
                b = min<int>(b+1,3);
                answer[i-1] = 'A';
            } else if (b>0 && dp[min<int>(a+1,3)][b-1][c][i-1]) {
                a = min<int>(a+1,3);
                b = b-1;
                answer[i-1] = 'B';
            } else if (b==3 && dp[min<int>(a+1,3)][b][c][i-1]) {
                a = min<int>(a+1,3);
                answer[i-1] = 'B';
            } else {
                assert(false);
            }
        }
        else if (s[i-1] == "BC") {
            if (b>0 && dp[a][b-1][min<int>(c+1,3)][i-1]) {
                b = b-1;
                c = min<int>(c+1,3);
                answer[i-1] = 'B';
            } else if (b==3 && dp[a][b][min<int>(c+1,3)][i-1]) {
                c = min<int>(c+1,3);
                answer[i-1] = 'B';
            } else if (c>0 && dp[a][min<int>(b+1,3)][c-1][i-1]) {
                b = min<int>(b+1,3);
                c = c-1;
                answer[i-1] = 'C';
            } else if (c==3 && dp[a][min<int>(b+1,3)][c][i-1]) {
                b = min<int>(b+1,3);
                answer[i-1] = 'C';
            } else {
                assert(false);
            }
        }
        else if (s[i-1] == "AC") {
            if (a>0 && dp[a-1][b][min<int>(c+1,3)][i-1]) {
                a = a-1;
                c = min<int>(c+1,3);
                answer[i-1] = 'A';
            } else if (a==3 && dp[a][b][min<int>(c+1,3)][i-1]) {
                c = min<int>(c+1,3);
                answer[i-1] = 'A';
            } else if (c>0 && dp[min<int>(a+1,3)][b][c-1][i-1]) {
                a = min<int>(a+1,3);
                c = c-1;
                answer[i-1] = 'C';
            } else if (c==3 && dp[min<int>(a+1,3)][b][c][i-1]) {
                a = min<int>(a+1,3);
                answer[i-1] = 'C';
            } else {
                assert(false);
            }
        }
    }
    cout << "Yes" << endl;
    rep(i,0,N) {
        cout << answer[i] << endl;
    }
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    long long N;
    scanf("%lld",&N);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    std::vector<std::string> s(N);
    for(int i = 0 ; i < N ; i++){
        std::cin >> s[i];
    }
    solve(N, A, B, C, std::move(s));
    return 0;
}


Measured memory_bytes: 7764