#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
constexpr int MOD = 1000000007;
constexpr int INF = 2147483647;
void yes(bool expr) {
  cout << (expr ? "Yes" : "No") << "\n";
}
lint A, B, C;
vector<string> ans;
void solve(lint X, lint Y, string Xs, string Ys, bool mode ) {
    if(X == 0 && Y == 0) {
        cout << "No" << endl;
        exit(0);
    } else if(X == 1 && Y == 1) {
        if(!mode) {
            ans.push_back(Xs);
            X++;
            Y--;
        } else {
            ans.push_back(Ys);
            Y++;
            X--;
        }
    } else if(Y > X) {
        ans.push_back(Xs);
        X++;
        Y--;
    } else {
        ans.push_back(Ys);
        Y++;
        X--;
    }
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    lint N;
    cin >> N >> A >> B >> C;
    vector<string> s(N);
    REP(i, N) cin >> s[i];
    REP(i, N) {
        string next = s[i];
        if(i < N-1) next = s[i+1];
        bool mode = true;
        if((s[i] == "AB" && next == "AC") || (s[i] == "BC" && next == "AB") || (s[i] == "AC" && next == "AB")) mode = false;
        if(s[i] == "AB") {
            if(A == 0 && B == 0) {
                cout << "No" << endl;
                exit(0);
            } else if(A == 1 && B == 1) {
                if(!mode) {
                    ans.push_back("A");
                    A++;
                    B--;
                } else {
                    ans.push_back("B");
                    B++;
                    A--;
                }
            } else if(B > A) {
                ans.push_back("A");
                A++;
                B--;
            } else {
                ans.push_back("B");
                B++;
                A--;
            }
        } else if(s[i] == "BC") {
            if(B == 0 && C == 0) {
                cout << "No" << endl;
                exit(0);
            } else if(B == 1 && C == 1) {
                if(!mode) {
                    ans.push_back("B");
                    B++;
                    C--;
                } else {
                    ans.push_back("C");
                    C++;
                    B--;
                }
            } else if(C > B) {
                ans.push_back("B");
                B++;
                C--;
            } else {
                ans.push_back("C");
                C++;
                B--;
            }
        } else {
            if(A == 0 && C == 0) {
                cout << "No" << endl;
                exit(0);
            } else if(A == 1 && C == 1) {
                if(!mode) {
                    ans.push_back("A");
                    A++;
                    C--;
                } else {
                    ans.push_back("C");
                    C++;
                    A--;
                }
            } else if(C > A) {
                ans.push_back("A");
                A++;
                C--;
            } else {
                ans.push_back("C");
                C++;
                A--;
            }
        }
    }
    cout << "Yes" << "\n";
    REP(i, N) cout << ans[i] << "\n";
}

Measured memory_bytes: 10544