#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

bool sfind(string s, string key) {
    return s.find(key) != string::npos;
}

int main() {
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    vector<string> s(n);
    rep(i, n) cin >> s[i];

    // ab, ac, bc
    int eq[3] = {0, 0, 0};

    vector<char> res;
    rep(i, n) {
        if (s[i] == "AB") {
            if (a == 0 && b == 0) {
                cout << "No" << endl;
                exit(0);
            }
            else if (a == 0) {
                a++;
                b--;
                res.push_back('A');
            }
            else if (b == 0) {
                a--;
                b++;
                res.push_back('B');
            }
            else {
                if (a > b) {
                    a--;
                    b++;
                    res.push_back('B');
                }
                else if (a < b) {
                    a++;
                    b--;
                    res.push_back('A');
                }
                else {
                    if (i+1 < n) {
                        if (sfind(s[i+1], "A")) {
                            a++;
                            b--;
                            res.push_back('A');
                        }
                        else {
                            a--;
                            b++;
                            res.push_back('B');
                        }
                    }
                    else {
                        a--;
                        b++;
                        res.push_back('B');
                    }
                }
            }
        }
        else if (s[i] == "AC") {
            if (a == 0 && c == 0) {
                cout << "No" << endl;
                exit(0);
            }
            else if (a == 0) {
                a++;
                c--;
                res.push_back('A');
            }
            else if (c == 0) {
                a--;
                c++;
                res.push_back('C');
            }
            else {
                if (a > c) {
                    a--;
                    c++;
                    res.push_back('C');
                }
                else if (a < c) {
                    a++;
                    c--;
                    res.push_back('A');
                }
                else {
                    if (i+1 < n) {
                        if (sfind(s[i+1], "A")) {
                            a++;
                            c--;
                            res.push_back('A');
                        }
                        else {
                            a--;
                            c++;
                            res.push_back('C');
                        }
                    }
                    else {
                        a--;
                        c++;
                        res.push_back('C');
                    }
                }
            }
        }
        else {
            if (b == 0 && c == 0) {
                cout << "No" << endl;
                exit(0);
            }
            else if (b == 0) {
                b++;
                c--;
                res.push_back('B');
            }
            else if (c == 0) {
                b--;
                c++;
                res.push_back('C');
            }
            else {
                if (b > c) {
                    b--;
                    c++;
                    res.push_back('C');
                }
                else if (b < c) {
                    b++;
                    c--;
                    res.push_back('B');
                }
                else {
                    if (i+1 < n) {
                        if (sfind(s[i+1], "B")) {
                            b++;
                            c--;
                            res.push_back('B');
                        }
                        else {
                            b--;
                            c++;
                            res.push_back('C');
                        }
                    }
                    else {
                        b--;
                        c++;
                        res.push_back('C');
                    }
                }
            }
        }
    }

    cout << "Yes" << endl;
    int v = res.size();
    rep(i, v) cout << res[i] << endl;
    return 0;
}

Measured memory_bytes: 6756