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

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPr(i, n) for(int i = (n)-1; i >= 0; --i)
#define FORq(i, m, n) for(int i = (m); i <= (n); ++i)
#define FORqr(i, m, n) for(int i = (n); i >= (m); --i)
#define MP make_pair
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x, 0, sizeof(x))
#define FILL(x, y) memset(x, y, sizeof(x))
#define MM(x) memset(x, -1, sizeof(x))
#define ALL(x) (x).begin(), (x).end()
#define DB(x) cerr << #x << " = " << x << endl
#define DB2(x, y)                                                              \
    cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n";
#define DEBUG                                                                  \
    int x12345;                                                                \
    cin >> x12345;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
const long long MOD = 1e9 + 7;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

///////////////////////////////////////////////
/// 🍈( '-' 🍈 |AC|
int main() {
    int N,A,B,C;
    cin >> N >> A >> B >> C;
    vector<string> s(N);
    REP(i,N){
        cin >> s[i];
    }

    vector<char> ans;

    if (A + B + C == 0){
        puts("No");
        return 0;
    }

    if (A + B + C == 1){
        REP(i,N){
            if (s[i] == "AB"){
                if (A == 0){
                    A++; B--; ans.push_back('A');
                }else{
                    A--; B++; ans.push_back('B');
                }
            }

            if (s[i] == "AC"){
                if (A == 0){
                    A++; C--; ans.push_back('A');
                }else{
                    A--; C++; ans.push_back('C');
                }
            }

            if (s[i] == "BC"){
                if (B == 0){
                    B++; C--; ans.push_back('B');
                }else{
                    B--; C++; ans.push_back('C');
                }
            }

            if ((A < 0) or (B < 0) or (C < 0)){
                puts("No");
                return 0;
            }
        }
    }

    if (A + B + C >= 2){
        REP(i,N){
            if (s[i] == "AB"){
                if ((A == 0) and (B > 0)){
                    A++; B--; ans.push_back('A');
                }else if ((A > 0) and (B == 0)){
                    A--; B++; ans.push_back('B');
                }else if ((A + B + C == 2) and ((A == 1) and (B == 1)) 
                         and (i != N - 1) and (s[i] != s[i+1])){
                            if (s[i+1] == "AC") {A++; B--; ans.push_back('A');}

                            if (s[i+1] == "BC") {B++; A--; ans.push_back('B');}
                         }
                else{
                    if (A <= B) {A++; B--; ans.push_back('A');}
                    else{B++; A--; ans.push_back('B');}
                }
            }

            if (s[i] == "AC"){
                if ((A == 0) and (C > 0)){
                    A++; C--; ans.push_back('A');
                }else if ((A > 0) and (C == 0)){
                    A--; C++; ans.push_back('C');
                }else if ((A + B + C == 2) and ((A == 1) and (C== 1)) 
                         and (i != N - 1) and (s[i] != s[i+1])){
                            if (s[i+1] == "AB") {A++; C--; ans.push_back('A');}
                            if (s[i+1] == "BC") {C++; A--; ans.push_back('C');}
                         }
                else{
                    if (A <= C) {A++; C--; ans.push_back('A');}
                    else{C++; A--; ans.push_back('C');}
                }
            }

            if (s[i] == "BC"){
                if ((B == 0) and (C > 0)){
                    B++; C--; ans.push_back('B');
                }else if ((B > 0) and (C == 0)){
                    B--; C++; ans.push_back('C');
                }else if ((A + B + C == 2) and ((B == 1) and (C == 1)) 
                         and (i != N - 1) and (s[i] != s[i+1])){
                            if (s[i+1] == "AC") {C++; B--; ans.push_back('C');}
                            if (s[i+1] == "AB") {B++; C--; ans.push_back('B');}
                         }
                else{
                    if (B <= C) {B++; C--; ans.push_back('B');}
                    else{C++; B--; ans.push_back('C');}
                }
            }

            //cout << "A = " << A << ", B = " << B << ", C = " << C << "\n";

            if ((A < 0) or (B < 0) or (C < 0)){
                puts("No");
                return 0;
            }
        }
    }

    cout << "Yes\n";
    REP(i,N){
        cout << ans[i] << "\n";
    }

}

Measured memory_bytes: 6740