#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <tuple>
#include <cassert>
#include <memory>
using namespace std;
typedef long long ll;
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;

int main ()
{
    ll N,A,B,C;
    cin >> N >> A >> B >> C;

    vector<string> s(N);
    for (int i = 0; i < N; i++) {
        cin >> s[i];
    }

    int idx = 0;
    string cur = s[0];

    vector<string> ans;

    while (idx < N) {
        int nidx = idx;
        while (nidx < N) {
            if (cur != s[nidx]) {
                break;
            }
            nidx++;
        }
        if (nidx == N) {
            auto st = s[idx];
            if (st == "AB") {
                for (int i = idx; i < nidx; i++) {
                    if (A > B) {
                        A--;
                        B++;
                        ans.push_back("B");
                    }
                    else {
                        A++;
                        B--;
                        ans.push_back("A");
                    }
                    if (A < 0 || B < 0) {
                        ans.clear();
                        goto finish;
                    }
                }
            }
            if (st == "AC") {
                for (int i = idx; i < nidx; i++) {
                    if (A > C) {
                        A--;
                        C++;
                        ans.push_back("C");
                    }
                    else {
                        A++;
                        C--;
                        ans.push_back("A");
                    }
                    if (A < 0 || C < 0) {
                        ans.clear();
                        goto finish;
                    }
                }
            }
            if (st == "BC") {
                for (int i = idx; i < nidx; i++) {
                    if (B > C) {
                        B--;
                        C++;
                        ans.push_back("C");
                    }
                    else {
                        B++;
                        C--;
                        ans.push_back("B");
                    }
                    if (B < 0 || C < 0) {
                        ans.clear();
                        goto finish;
                    }
                }
            }
            idx = nidx;
        }
        ///////////////////////////////////////////////////////
        else {
            auto st1 = s[idx];
            auto st2 = s[nidx];
            string pri = "";
            if (st1 == "AB" && st2 == "AC") {
                pri = "A";
            }
            if (st1 == "AB" && st2 == "BC") {
                pri = "B";
            }
            if (st1 == "AC" && st2 == "BC") {
                pri = "C";
            }
            if (st1 == "AC" && st2 == "AB") {
                pri = "A";
            }
            if (st1 == "BC" && st2 == "AB") {
                pri = "B";
            }
            if (st1 == "BC" && st2 == "AC") {
                pri = "C";
            }
            /////////////////////////////
            for (int i = idx; i < nidx; i++) {
                if (st1 == "AB") {
                    if (pri == "A") {
                        if (B > 0) {
                            A++;
                            B--;
                            ans.push_back("A");
                        }
                        else {
                            A--;
                            B++;
                            ans.push_back("B");
                        }
                    }
                    if (pri == "B") {
                        if (A > 0) {
                            A--;
                            B++;
                            ans.push_back("B");
                        }
                        else {
                            A++;
                            B--;
                            ans.push_back("A");
                        }
                    }
                    if (A < 0 || B < 0) {
                        ans.clear();
                        goto finish;
                    }
                }
            }
            //////////////////////////////////
            for (int i = idx; i < nidx; i++) {
                if (st1 == "AC") {
                    if (pri == "A") {
                        if (C > 0) {
                            A++;
                            C--;
                            ans.push_back("A");
                        }
                        else {
                            A--;
                            C++;
                            ans.push_back("C");
                        }
                    }
                    if (pri == "C") {
                        if (A > 0) {
                            A--;
                            C++;
                            ans.push_back("C");
                        }
                        else {
                            A++;
                            C--;
                            ans.push_back("A");
                        }
                    }
                    if (A < 0 || C < 0) {
                        ans.clear();
                        goto finish;
                    }
                }
            }
            ///////////////////////////////////////
            for (int i = idx; i < nidx; i++) {
                if (st1 == "BC") {
                    if (pri == "B") {
                        if (C > 0) {
                            B++;
                            C--;
                            ans.push_back("B");
                        }
                        else {
                            B--;
                            C++;
                            ans.push_back("C");
                        }
                    }
                    if (pri == "C") {
                        if (B > 0) {
                            B--;
                            C++;
                            ans.push_back("C");
                        }
                        else {
                            B++;
                            C--;
                            ans.push_back("B");
                        }
                    }
                    if (B < 0 || C < 0) {
                        ans.clear();
                        goto finish;
                    }
                }
            }
            idx = nidx;
            cur = s[nidx];
        }
    }

    finish:;

    if (ans.size() == N) {
        cout << "Yes" << endl;
        for (auto x: ans) {
            cout << x << endl;
        }
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 10596