#include <cstdio>
#include <set>
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

#define ll long long
const ll N = 1000000000;

int main(){
    int n;
    ll a, b, c;
    cin >> n >> a >> b >> c;

    vector<char> ans(n);

    for (int i = 0; i < n; ++i) {
        string s; cin >> s;

        if (s == "AB") {
            if (a == 0 && b == 0) {
                cout << "No";
                return 0;
            }

            if (a == b && b == 1 && c == 0 && i < n - 1) {
                string t; cin >> t;
                if (t == "AB") {
                    ans[i] = 'A';
                    ++i;
                    ans[i] = 'B';
                }
                if (t == "AC") {
                    ans[i] = 'A';
                    ++i;
                    ans[i] = 'C';
                    a = 1; c = 1; b = 0;
                }
                if (t == "BC") {
                    ans[i] = 'B';
                    ++i;
                    ans[i] = 'C';
                    b = 1; c = 1; a = 0;
                }
            }

            else if (a >= b) {
                ans[i] = 'B';
                ++b; --a;
            }

            else if (a < b) {
                ans[i] = 'A';
                ++a; --b;
            }
        }

        if (s == "AC") {
            if (a == 0 && c == 0) {
                cout << "No";
                return 0;
            }

            if (a == c && c == 1 && b == 0 && i < n - 1) {
                string t; cin >> t;
                if (t == "AC") {
                    ans[i] = 'A';
                    ++i;
                    ans[i] = 'C';
                }
                if (t == "AB") {
                    ans[i] = 'A';
                    ++i;
                    ans[i] = 'B';
                    a = 1; b = 1; c = 0;
                }
                if (t == "BC") {
                    ans[i] = 'C';
                    ++i;
                    ans[i] = 'B';
                    a = 0; b = 1; c = 1;
                }
            }

            else if (a >= c) {
                ans[i] = 'C';
                ++c; --a;
            }

            else if (a < c) {
                ans[i] = 'A';
                ++a; --c;
            }
        }

        if (s == "BC") {
            if (b == 0 && c == 0) {
                cout << "No";
                return 0;
            }

            if (b == c && c == 1 && a == 0 && i < n - 1) {
                string t; cin >> t;
                if (t == "BC") {
                    ans[i] = 'B';
                    ++i;
                    ans[i] = 'C';
                }
                if (t == "AB") {
                    ans[i] = 'B';
                    ++i;
                    ans[i] = 'A';
                    a = 1; b = 1; c = 0;
                }
                if (t == "AC") {
                    ans[i] = 'C';
                    ++i;
                    ans[i] = 'A';
                    a = 1; b = 0; c = 1;
                }
            }

            else if (b >= c) {
                ans[i] = 'C';
                ++c; --b;
            }

            else if (b < c) {
                ans[i] = 'B';
                ++b; --c;
            }
        }
    }

    cout << "Yes" << endl;
    for (char t : ans) {
        cout << t << endl;
    }

    return 0;
}


Measured memory_bytes: 3732