#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i, x) for (long long i = 0; i < x; i++)
#define repn(i, x) for (long long i = 1; i <= x; i++)
#define SORT(x) sort(x.begin(), x.end())
#define ERASE(x) x.erase(unique(x.begin(), x.end()), x.end())
#define POSL(x, v) (lower_bound(x.begin(), x.end(), v) - x.begin())
#define POSU(x, v) (upper_bound(x.begin(), x.end(), v) - x.begin())
vector<pair<string, P> > vec;
// vector<vector<int>> data(3, vector<int>(4));

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

void solve(long long N, long long A, long long B, long long C, std::vector<std::string> s) {
    vector<int> Q(N);
    bool flg = true;
    rep(i, N) {
        if (s[i] == "AB") {
            if ((A == 0 && B >= 1) || (A == 1 && B == 1 && i + 1 < N && s[i + 1] == "AC")) {
                A++;
                B--;
                Q[i] = 0;
            } else if ((A >= 1 && B == 0) || (A == 1 && B == 1 && i + 1 < N && s[i + 1] == "BC")) {
                A--;
                B++;
                Q[i] = 1;
            } else if (A == 0 && B == 0) {
                flg = false;
                break;
            } else {
                if (A < B) {
                    A++;
                    B--;
                    Q[i] = 0;
                } else {
                    A--;
                    B++;
                    Q[i] = 1;
                }
            }
        }
        if (s[i] == "AC") {
            if ((A == 0 && C >= 1) || (A == 1 && C == 1 && i + 1 < N && s[i + 1] == "AB")) {
                A++;
                C--;
                Q[i] = 0;
            } else if ((A >= 1 && C == 0) || (A == 1 && C == 1 && i + 1 < N && s[i + 1] == "BC")) {
                A--;
                C++;
                Q[i] = 2;
            } else if (A == 0 && C == 0) {
                flg = false;
                break;
            } else {
                if (A < C) {
                    A++;
                    C--;
                    Q[i] = 0;
                } else {
                    A--;
                    C++;
                    Q[i] = 2;
                }
            }
        }
        if (s[i] == "BC") {
            if ((B == 0 && C >= 1) || (B == 1 && C == 1 && i + 1 < N && s[i + 1] == "AB")) {
                B++;
                C--;
                Q[i] = 1;
            } else if ((B >= 1 && C == 0) || (B == 1 && C == 1 && i + 1 < N && s[i + 1] == "AC")) {
                B--;
                C++;
                Q[i] = 2;
            } else if (B == 0 && C == 0) {
                flg = false;
                break;
            } else {
                if (B < C) {
                    B++;
                    C--;
                    Q[i] = 1;
                } else {
                    B--;
                    C++;
                    Q[i] = 2;
                }
            }
        }
    }
    if (flg) {
        cout << "Yes" << endl;
        rep(i, N) { printf("%c\n", 'A' + Q[i]); }
        // cout << A << " " << B << " " << C << endl;
    } else {
        cout << "No" << endl;
    }
}

int main() {
    long long N;
    scanf("%lld", &N);
    long long A;
    scanf("%lld", &A);
    long long B;
    scanf("%lld", &B);
    long long C;
    scanf("%lld", &C);
    std::vector<std::string> s(N);
    for (int i = 0; i < N; i++) {
        std::cin >> s[i];
    }
    solve(N, A, B, C, std::move(s));
    return 0;
}


Measured memory_bytes: 6728