#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
// template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, a, b, c; cin >> n >> a >> b >> c;
    vector<string> s(n); rep (i, n) cin >> s[i];

    int state = (a == 0) + (b == 0) + (c == 0);
    ll da = 0, db = 0, dc = 0;
    bool ok = false;
    vector<char> ans(n);
    rep (i, n) {
        if (state == 0) {
            ok = true;
            if (s[i] == "AB") {
                if (da >= db) {
                    ans[i] = 'B';
                    // cout << "B\n";
                    db++; da--;
                } else {
                    ans[i] = 'A';
                    // cout << "A\n";
                    da++; db--;
                }
            } else if (s[i] == "BC") {
                if (db >= dc) {
                    ans[i] = 'C';
                    // cout << "C\n";
                    dc++; db--;
                } else {
                    ans[i] = 'B';
                    // cout << "B\n";
                    db++; dc--;
                }
            } else {
                if (da >= dc) {
                    ans[i] = 'C';
                    // cout << "C\n";
                    dc++; da--;
                } else {
                    ans[i] = 'A';
                    // cout << "A\n";
                    da++; dc--;
                }
            }
        } else if (state == 3) {
            cout << "No\n";
            return 0;
        } else if (state == 1) {
            if (s[i] == "AB") {
                if (a == 0 || (a < b) || (a == 1 && b == 1 && i != n - 1 && s[i + 1] == "AC")) {
                    ans[i] = 'A';
                    a++; b--;
                    state = (a == 0) + (b == 0) + (c == 0);
                } else {
                    ans[i] = 'B';
                    b++; a--;
                    state = (a == 0) + (b == 0) + (c == 0);
                }
            }
            if (s[i] == "BC") {
                if (c == 0 || (c == 1 && b == 1 && i != n - 1 && s[i + 1] == "AC") || (c < b)) {
                    ans[i] = 'C';
                    c++; b--;
                    state = (a == 0) + (b == 0) + (c == 0);
                } else {
                    ans[i] = 'B';
                    b++; c--;
                    state = (a == 0) + (b == 0) + (c == 0);
                }
            }
            if (s[i] == "AC") {
                if (a == 0 || (a == 1 && c == 1 && i != n - 1 && s[i + 1] == "AB") || (a < c)) {
                    ans[i] = 'A';
                    a++; c--;
                    state = (a == 0) + (b == 0) + (c == 0);
                } else {
                    ans[i] = 'C';
                    c++; a--;
                    state = (a == 0) + (b == 0) + (c == 0);
                }
            }
        } else if (state == 2) {
            if ((s[i] == "AB" && a == 0 && b == 0) ||
            (s[i] == "AC" && a == 0 && c == 0) ||
            (s[i] == "BC" && c == 0 && b == 0)) {
                cout << "No\n";
                return 0;
            } else {
                if (s[i] == "AB") {
                    if (a == 0) {
                        ans[i] = 'A';
                        a++; b--;
                        state = (a == 0) + (b == 0) + (c == 0);
                    } else {
                        ans[i] = 'B';
                        b++; a--;
                        state = (a == 0) + (b == 0) + (c == 0);
                    }
                }
                if (s[i] == "BC") {
                    if (c == 0) {
                        ans[i] = 'C';
                        c++; b--;
                        state = (a == 0) + (b == 0) + (c == 0);
                    } else {
                        ans[i] = 'B';
                        b++; c--;
                        state = (a == 0) + (b == 0) + (c == 0);
                    }
                }
                if (s[i] == "AC") {
                    if (a == 0) {
                        ans[i] = 'A';
                        a++; c--;
                        state = (a == 0) + (b == 0) + (c == 0);
                    } else {
                        ans[i] = 'C';
                        c++; a--;
                        state = (a == 0) + (b == 0) + (c == 0);
                    }
                }
            }
        }
    }
    cout << "Yes\n";
    rep (i, n) cout << ans[i] << "\n";
    return 0;
}

Measured memory_bytes: 6624