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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;

int main(){
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    vector<string> s(n);
    for (int i = 0; i < n; ++i) {
        cin >> s[i];
    }

    if (s[0] == "AB" && a == 0 && b == 0){
        cout << "No" << endl;
        return 0;
    } else if (s[0] == "BC" && b == 0 && c == 0){
        cout << "No" << endl;
        return 0;
    } else if (s[0] == "AC" && a == 0 && c == 0){
        cout << "No" << endl;
        return 0;
    }

    if (a + b + c > 1){
        cout << "Yes" << endl;
        for (int i = 0; i < n; ++i) {
            if (s[i] == "AB"){
                if (a == b){
                    if (i < n-1){
                        if (s[i+1] == "BC") {
                            cout << "B" << endl;
                            a--; b++;
                        } else{
                            cout << "A" << endl;
                            a++; b--;
                        }
                    } else{
                        cout << "A" << endl;
                        a++; b--;
                    }
                } else if (a > b){
                    cout << "B" << endl;
                    a--; b++;
                } else{
                    cout << "A" << endl;
                    a++; b--;
                }
            }
            if (s[i] == "BC"){
                if (b == c) {
                    if (i < n - 1) {
                        if (s[i + 1] == "AC") {
                            cout << "C" << endl;
                            b--; c++;
                        } else{
                            cout << "B" << endl;
                            b++; c--;
                        }
                    } else {
                        cout << "B" << endl;
                        b++; c--;
                    }
                } else if (b > c){
                    cout << "C" << endl;
                    b--; c++;
                } else{
                    cout << "B" << endl;
                    b++; c--;
                }
            }
            if (s[i] == "AC"){
                if (a == c) {
                    if (i < n - 1) {
                        if (s[i + 1] == "AB") {
                            cout << "A" << endl;
                            a++; c--;
                        } else{
                            cout << "C" << endl;
                            a--; c++;
                        }
                    } else {
                        cout << "C" << endl;
                        a--; c++;
                    }
                } else if (a > c){
                    cout << "C" << endl;
                    a--; c++;
                } else{
                    cout << "A" << endl;
                    a++; c--;
                }
            }
        }
    } else{
        string res = "";
        for (int i = 0; i < n; ++i) {
            if (s[i] == "AB"){
                if (a == 0 && b == 0){
                    cout << "No" << endl;
                    return 0;
                }
                if (a > b){
                    res += "B";
                    a--; b++;
                } else{
                    res += "A";
                    a++; b--;
                }
            }
            if (s[i] == "BC"){
                if (b == 0 && c == 0){
                    cout << "No" << endl;
                    return 0;
                }
                if (b > c){
                    res += "C";
                    b--; c++;
                } else{
                    res += "B";
                    b++; c--;
                }
            }
            if (s[i] == "AC"){
                if (a == 0 && c == 0){
                    cout << "No" << endl;
                    return 0;
                }
                if (a > c){
                    res += "C";
                    a--; c++;
                } else{
                    res += "A";
                    a++; c--;
                }
            }
        }
        cout << "Yes" << endl;
        for (int i = 0; i < n; ++i) {
            cout << res[i] << endl;
        }
    }
}

Measured memory_bytes: 6572