#include <bits/stdc++.h>
#define FOR(i, x, y) for (int i = x; i < y; i++)
typedef long long ll;
using namespace std;

map<string, queue<int>> cnt;
string m[100001];

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    if (a && b && c) {
        cout << "Yes\n";
        while (n--) {
            string s;
            cin >> s;
            if (s == "AB") {
                if (a > b) {
                    cout << "B\n";
                    a--, b++;
                } else {
                    cout << "A\n";
                    a++, b--;
                }
            } else if (s == "AC") {
                if (a > c) {
                    cout << "C\n";
                    a--, c++;
                } else {
                    cout << "A\n";
                    a++, c--;
                }
            } else {
                if (b > c) {
                    cout << "C\n";
                    b--, c++;
                } else {
                    cout << "B\n";
                    b++, c--;
                }
            }
            assert(a > -1 && b > -1 && c > -1);
        }
    } else {
        vector<char> moves;
        FOR(i, 0, n) {
            cin >> m[i];
            cnt[m[i]].push(i);
        }
        cnt["AB"].push(INT_MAX);
        cnt["BC"].push(INT_MAX);
        cnt["AC"].push(INT_MAX);
        FOR(i, 0, n) {
            cnt[m[i]].pop();
            if (m[i] == "AB") {
                if (a == b && a == 1) {
                    if (c == 0 && cnt["BC"].front() < cnt["AC"].front() && cnt["BC"].front() < cnt["AB"].front()) {
                        moves.push_back('B');
                        a--, b++;
                    } else {
                        moves.push_back('A');
                        a++, b--;
                    }
                } else if (a > b) {
                    moves.push_back('B');
                    a--, b++;
                } else {
                    moves.push_back('A');
                    a++, b--;
                }
            } else if (m[i] == "AC") {
                if (a == c && a == 1) {
                    if (b == 0 && cnt["BC"].front() < cnt["AC"].front() && cnt["BC"].front() < cnt["AB"].front()) {
                        moves.push_back('C');
                        a--, c++;
                    } else {
                        moves.push_back('A');
                        a++, c--;
                    }
                } else if (a > c) {
                    moves.push_back('C');
                    a--, c++;
                } else {
                    moves.push_back('A');
                    a++, c--;
                }
            } else {
                if (b == c && b == 1) {
                    if (a == 0 && cnt["AC"].front() < cnt["BC"].front() && cnt["AC"].front() < cnt["AB"].front()) {
                        moves.push_back('C');
                        b--, c++;
                    } else {
                        moves.push_back('B');
                        b++, c--;
                    }
                } else if (b > c) {
                    moves.push_back('C');
                    b--, c++;
                } else {
                    moves.push_back('B');
                    b++, c--;
                }
            }

            if (a < 0 || b < 0 || c < 0) return cout << "No", 0;
        }

        cout << "Yes\n";
        for (char i : moves) cout << i << '\n';
    }
    return 0;
}

Measured memory_bytes: 7348