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

using ll = long long;
using pii = pair<int, int>;

#define vt          vector
#define sz(x)       (int)(x).size()
#define all(x)      (x).begin(), (x).end()
#define rall(x)     (x).rbegin(), (x).rend()
#define fi          first
#define se          second

#define die return cout << "No\n", 0

signed main() {
    ios::sync_with_stdio(0), cin.tie(0);

    int n, a, b, c;
    cin >> n >> a >> b >> c;
    queue<pair<string, int>> q;
    while (n--) {
        string t;
        cin >> t;
        if (q.empty() || q.back().fi != t) q.emplace(t, 1);
        else q.back().se++;
    }

    vt<char> ops;
    auto f = [&](int &x, int &y, string st) {
        if (!x && !y) return '\0';
        else if (x < y) return x++, y--, st[0];
        else return x--, y++, st[1];
    };

    auto f2 = [&](string st) {
        char ch = 
            st == "AB" ? f(a, b, st) :
            st == "AC" ? f(a, c, st) :
            f(b, c, st);
        ops.push_back(ch);
        return bool(ch);
    };

    while (!q.empty()) {
        auto cur = q.front();
        q.pop();

        if (a + b + c != 2 || 
                (cur.fi == "AB" && a + b != 2) ||
                (cur.fi == "AC" && a + c != 2) ||
                (cur.fi == "BC" && b + c != 2)) {
            while (cur.se--) {
                if (!f2(cur.fi)) die;
            }
            continue;
        }

        while (cur.se > 2) {
            if (!f2(cur.fi)) die;
            if (!f2(cur.fi)) die;
            cur.se -= 2;
        }

        bool any2 = a == 2 || b == 2 || c == 2;
        if (!q.empty()) {
            string next = q.front().fi;

            if (cur.se == 1 && !any2) {
                if (!count(all(next), 'A')) {
                    if (count(all(cur.fi), 'B')) {
                        ops.push_back('B');
                        b++;
                    } else {
                        ops.push_back('C');
                        c++;
                    }
                    a--;
                } else if (!count(all(next), 'B')) {
                    if (count(all(cur.fi), 'A')) {
                        ops.push_back('A');
                        a++;
                    } else {
                        ops.push_back('C');
                        c++;
                    }
                    b--;
                } else {
                    if (count(all(cur.fi), 'A')) {
                        ops.push_back('A');
                        a++;
                    } else {
                        ops.push_back('B');
                        b++;
                    }
                    c--;
                }

                continue;
            } else if (cur.se == 2 && any2) {
                if (!count(all(next), 'A')) {
                    bool isB = count(all(cur.fi), 'B');
                    if (!a) ops.push_back('A');
                    else ops.push_back(isB ? 'B' : 'C');

                    if (isB) {
                        ops.push_back('B');
                        b = 2;
                    } else {
                        ops.push_back('C');
                        c = 2;
                    }
                    a = 0;
                } else if (!count(all(next), 'B')) {
                    bool isA = count(all(cur.fi), 'A');
                    if (!b) ops.push_back('B');
                    else ops.push_back(isA ? 'A' : 'C');

                    if (isA) {
                        ops.push_back('A');
                        a = 2;
                    } else {
                        ops.push_back('C');
                        c = 2;
                    }
                    b = 0;
                } else {
                    bool isA = count(all(cur.fi), 'A');
                    if (!c) ops.push_back('C');
                    else ops.push_back(isA ? 'A' : 'B');

                    if (isA) {
                        ops.push_back('A');
                        a = 2;
                    } else {
                        ops.push_back('B');
                        b = 2;
                    }
                    c = 0;
                }

                continue;
            }
        }

        while (cur.se--) {
            if (!f2(cur.fi)) die;
        }
    }

    cout << "Yes\n";
    for (char ch : ops) cout << ch << '\n';
}


Measured memory_bytes: 6152