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

using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;

template <class T>
using max_heap = priority_queue<T>;
template <class T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;

template <class T, class U>
void chmax(T &a, U b) {
    if (a < b) a = b;
}
template <class T, class U>
void chmin(T &a, U b) {
    if (b < a) a = b;
}

#define rep(i, j, k) for (int i = j; i < k; i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << endl;
#define int ll

const ll mod = 1e9 + 7;
const ll inf = (1LL << 60);

const string YES = "Yes";
const string NO = "No";

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    int n, a, b, c;
    cin >> n >> a >> b >> c;

    vector<string> s(n);
    rep(i, 0, n) cin >> s[i];

    vector<char> ans(n);
    rep(i, 0, n) {
        if (s[i] == "AB") {
            if (a > b) {
                a--, b++;
                ans[i] = 'B';
            } else if (a < b) {
                a++, b--;
                ans[i] = 'A';
            } else {
                if (i < n - 1 and s[i] != s[i + 1]) {
                    if (s[i + 1][0] == 'B') {
                        a--, b++;
                        ans[i] = 'B';
                    } else {
                        a++, b--;
                        ans[i] = 'A';
                    }
                } else {
                    a--, b++;
                    ans[i] = 'B';
                }
            }
        }
        if (s[i] == "BC") {
            if (b > c) {
                b--, c++;
                ans[i] = 'C';
            } else if (b < c) {
                b++, c--;
                ans[i] = 'B';
            } else {
                if (i < n - 1 and s[i] != s[i + 1]) {
                    if (s[i + 1][1] == 'B') {
                        b++, c--;
                        ans[i] = 'B';
                    } else {
                        b--, c++;
                        ans[i] = 'C';
                    }
                } else {
                    b--, c++;
                    ans[i] = 'C';
                }
            }
        }
        if (s[i] == "AC") {
            if (c > a) {
                c--, a++;
                ans[i] = 'A';
            } else if (c < a) {
                c++, a--;
                ans[i] = 'C';
            } else {
                if (i < n - 1 and s[i] != s[i + 1]) {
                    if (s[i + 1][0] == 'B') {
                        c++, a--;
                        ans[i] = 'C';
                    } else {
                        c--, a++;
                        ans[i] = 'A';
                    }
                } else {
                    a--, c++;
                    ans[i] = 'C';
                }
            }
        }

        // cerr << "abc : " << a << " : " << b << " : " << c << endl;
        if (a < 0 or b < 0 or c < 0) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
    rep(i, 0, n) {
        cout << ans[i] << endl;
    }
    // int ca = 0, cb = 0, cc = 0;
    // rep(i, 0, n) {
    //     if (s[i] == "AB") {
    //         ca++, cb++;
    //     }
    //     if (s[i] == "BC") {
    //         cc++, cb++;
    //     }
    //     if (s[i] == "AC") {
    //         cc++, ca++;
    //     }
    // }
    return 0;
}


Measured memory_bytes: 6616