#include <iostream>
#include <iomanip> //! for setprecision(10)
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>
#include <stack>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>

using namespace std;

typedef long long LL;

#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define rep(i,n) for (int i = 0; i < (n); ++i)

const int MOD = 1000000007;

struct State {
    State(int _i, int _A, int _B, int _C) : i(_i), A(_A), B(_B), C(_C) {}

    int i;
    int A;
    int B;
    int C;
};

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(0);

    int N, A, B, C;
    cin >> N >> A >> B >> C;
    vector<string> s(N);
    rep(i, N) cin >> s[i];

    stack<State> st;
    vector<char> ans(N);
    for (int i = 0; i < N; ++i) {
        State state(i, A, B, C);
        bool backtrack = false;
        if (s[i]=="AB") {
            if (A < B) {
                ans[i] = 'A';
                ++A;
                --B;
            } else if (B < A) {
                ans[i] = 'B';
                --A;
                ++B;   
            } else if (A == 0) {
                //! A==B==0
                backtrack = true;
            } else if (ans[i]=='A') {
                ans[i] = 'B';
                --A;
                ++B;        
            } else if (ans[i]=='B') {
                backtrack = true;
            } else {
                ans[i] = 'A';
                ++A;
                --B;
                st.push(state);
            }
        } else if (s[i]=="BC") {
            if (B < C) {
                ans[i] = 'B';
                ++B;
                --C;
            } else if (C < B) {
                ans[i] = 'C';
                --B;
                ++C;   
            } else if (B == 0) {
                //! B==C==0
                backtrack = true;
            } else if (ans[i]=='B') {
                ans[i] = 'C';
                --B;
                ++C;        
            } else if (ans[i]=='C') {
                backtrack = true;
            } else {
                ans[i] = 'B';
                ++B;
                --C;
                st.push(state);
            }
        } else {
            if (C < A) {
                ans[i] = 'C';
                ++C;
                --A;
            } else if (A < C) {
                ans[i] = 'A';
                --C;
                ++A;   
            } else if (C == 0) {
                //! C==A==0
                backtrack = true;
            } else if (ans[i]=='C') {
                ans[i] = 'A';
                --C;
                ++A;        
            } else if (ans[i]=='A') {
                backtrack = true;
            } else {
                ans[i] = 'C';
                ++C;
                --A;
                st.push(state);
            }
        }
        if (A < 0 || B < 0 || C < 0) {
            backtrack = true;
        }
        if (backtrack) {
            if (st.empty()) {
                cout << "No" << endl;
                return 0;
            } else {
                State bs = st.top(); st.pop();
                i = bs.i;
                A = bs.A;
                B = bs.B;
                C = bs.C;
                for (int j = i+1; j < N; ++j) {
                    ans[j] = 0; //! clear the tentative answers that are rewinded
                }
                --i; //! i will be imcremented by for loop
            }
        }
    }

    cout << "Yes\n";
    rep(i, N) cout << ans[i] << endl;

    return 0;
}


Measured memory_bytes: 6972