/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>

#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>

#include <cmath>
#include <numeric>
#include <random>
#include <cstring>
#include <cassert>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <stack>

// type
#include <cstdint>
#include <functional>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
template <class T> using MaxHeap = priority_queue<T>;
template <class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
#define P pair<ll, ll>

/* ---------- Constants  */
const double PI = 3.141592653589793238462643383279;
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;

/* ---------- Functions */
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */
signed main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int N, A, B, C;
    cin >> N >> A >> B >> C;
    vector<string> strs(N);
    for (int i = 0; i <N; i++) cin >> strs[i];

    bool ok = true;
    vector<string> ans;
    for (int i = 0; i < N; i++) {
        if (strs[i] == "AB") {
            if (A > 0 && A == B && i < N-1) {
                if (strs[i+1] == "BC") {
                    A--;
                    B++;
                    ans.push_back("B");
                } else {
                    A++;
                    B--;
                    ans.push_back("A");
                }
                continue;
            }

            if (A >= B) {
                A--;
                B++;
                if (A < 0) ok = false;
                ans.push_back("B");
            } else {
                A++;
                B--;
                if (B < 0) ok = false;
                ans.push_back("A");
            }
        } else if (strs[i] == "AC") {
            if (A > 0 && A == C && i < N-1) {
                if (strs[i+1] == "BC") {
                    A--;
                    C++;
                    ans.push_back("C");
                } else {
                    A++;
                    C--;
                    ans.push_back("A");
                }
                continue;
            }

            if (A >= C) {
                A--;
                C++;
                if (A < 0) ok = false;
                ans.push_back("C");
            } else {
                A++;
                C--;
                if (C < 0) ok = false;
                ans.push_back("A");
            }
        } else {
            if (B > 0 && B == C && i < N-1) {
                if (strs[i+1] == "AC") {
                    B--;
                    C++;
                    ans.push_back("C");
                } else {
                    B++;
                    C--;
                    ans.push_back("B");
                }
                continue;
            }

            if (B >= C) {
                B--;
                C++;
                if (B < 0) ok = false;
                ans.push_back("C");
            } else {
                B++;
                C--;
                if (C < 0) ok = false;
                ans.push_back("B");
            }
        }
    }

    if (ok) {
        cout << "Yes" << endl;
        for (string s : ans)cout << s << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 10560