#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    vs s(n);
    rep(i, n) cin >> s[i];
    bool flag = true;
    vc ans;
    rep(i, n) {
        if (s[i] == "AB") {
            if (a == 0 && b == 0) {
                flag = false;
                break;
            }
            if (a == 1 && b == 1) {
                if (i == n-1 || s[i+1] == s[i]) {
                    ans.pb('A');
                    b--;
                    a++;
                } else if (s[i+1] == "BC") {
                    ans.pb('B');
                    b++;
                    a--;
                } else {
                    ans.pb('A');
                    b--;
                    a++;
                }
            } else if (a > b) {
                ans.pb('B');
                a--;
                b++;
            } else {
                ans.pb('A');
                b--;
                a++;
            }
        } else if (s[i] == "AC") {
            if (a == 0 && c == 0) {
                flag = false;
                break;
            }
            if (a == 1 && c == 1) {
                if (i == n-1 || s[i+1] == s[i]) {
                    ans.pb('A');
                    c--;
                    a++;
                } else if (s[i+1] == "AB") {
                    ans.pb('A');
                    a++;
                    c--;
                } else {
                    ans.pb('C');
                    a--;
                    c++;
                }
            } else if (a > c) {
                ans.pb('C');
                a--;
                c++;
            } else {
                ans.pb('A');
                c--;
                a++;
            }
        } else {
            if (b == 0 && c == 0) {
                flag = false;
                break;
            }
            if (b == 1 && c == 1) {
                if (i == n-1 || s[i+1] == s[i]) {
                    ans.pb('B');
                    c--;
                    b++;
                } else if (s[i+1] == "AB") {
                    ans.pb('B');
                    b++;
                    c--;
                } else {
                    ans.pb('C');
                    b--;
                    c++;
                }
            } else if (b > c) {
                ans.pb('C');
                b--;
                c++;
            } else {
                ans.pb('B');
                c--;
                b++;
            }
        }
    }
    if (flag) {
        cout << "Yes" << endl;
        rep(i, n) cout << ans[i] << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 6692