#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin(), v.end()
#define ITR(v, i) for(auto ite = v.begin(); ite != v.end(); ite++)
const ll INF = 999999999999999;
const ll MOD = 1000000007;
const ll MAX_N = 500010;
ll a, b, c, d, e, f, p, t, x, y, z, q, m, n, r, h, k, w, l, ans;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    vl A, ANS;
    cin >> n >> a >> b >> c;
    rep(i, n) {
        cin >> S;
        if(S == "AB") {
            x++;
            A.push_back(3);
        }
        if(S == "BC") {
            y++;
            A.push_back(6);
        }
        if(S == "AC") {
            z++;
            A.push_back(5);
        }
    }

    A.push_back(8);

    reverse(all(A));
    vl B;
    rep(i, n) {
        if(A[i] != A[i + 1])
            B.push_back(A[i] & A[i + 1]);
        else
            B.push_back(B.back());
    }

    reverse(all(B));
    reverse(all(A));

    rep(i, n) {
        if(A[i] == 3) {
            if(a >= 2 && b >= 2) {
                a--;
                b++;
                ANS.push_back(2);
            } else if(a < b) {
                a++;
                b--;
                ANS.push_back(1);
            } else if(a > b) {
                a--;
                b++;
                ANS.push_back(2);
            } else if(a == 0 && b == 0) {
                cout << "No" << endl;
                return 0;

            } else if(B[i] == 1) {
                a++;
                b--;
                ANS.push_back(1);
            } else {
                a--;
                b++;
                ANS.push_back(2);
            }
        }
        if(A[i] == 6) {
            if(b >= 2 && c >= 2) {
                b--;
                c++;
                ANS.push_back(3);
            } else if(b < c) {
                b++;
                c--;
                ANS.push_back(2);
            } else if(b > c) {
                b--;
                c++;
                ANS.push_back(3);
            } else if(b == 0 && c == 0) {
                cout << "No" << endl;
                return 0;

            } else if(B[i] == 2) {
                b++;
                c--;
                ANS.push_back(2);
            } else {
                b--;
                c++;
                ANS.push_back(3);
            }
        }
        if(A[i] == 5) {
            if(c >= 2 && a >= 2) {
                c--;
                a++;
                ANS.push_back(1);
            } else if(c < a) {
                c++;
                a--;
                ANS.push_back(3);
            } else if(c > a) {
                c--;
                a++;
                ANS.push_back(1);
            } else if(c == 0 && a == 0) {
                cout << "No" << endl;
                return 0;

            } else if(B[i] == 4) {
                c++;
                a--;
                ANS.push_back(3);
            } else {
                c--;
                a++;
                ANS.push_back(1);
            }
        }

    }

    cout << "Yes" << endl;
    rep(i, n) {
        if(ANS[i] == 1)
            cout << "A" << endl;
        if(ANS[i] == 2)
            cout << "B" << endl;
        if(ANS[i] == 3)
            cout << "C" << endl;
    }
}

Measured memory_bytes: 6380