#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second

using namespace std;
using ll = long long;
using P = pair<int, int>;
using LP = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) {if (a > b) { a = b; return true; } return false; }

ll INF = 1001001001;
ll LINF = 1001001001001001001ll;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll n, a, b, c;
    cin>>n>>a>>b>>c;
    vector<string> ss(n);
    cin>>ss;

    string ans = "";
    rep(i, n) {
        string s = ss[i];
        if (s == "AB") {
            if (i != n - 1 && a == 1 && b == 1) {
                if (ss[i + 1] == "BC") {
                    a--; b++;
                    ans.push_back('B');
                }
                else {
                    a++; b--;
                    ans.push_back('A');
                }
            }
            else if (a == 0) {
                a++; b--;
                ans.push_back('A');
            }
            else if (b <= a) {
                a--; b++;
                ans.push_back('B');
            }
            else {
                a++; b--;
                ans.push_back('A');
            }
        }
        else if (s == "BC") {
            if (i != n - 1 && b == 1 && c == 1) {
                if (ss[i + 1] == "AC") {
                    b--; c++;
                    ans.push_back('C');
                }
                else {
                    b++; c--;
                    ans.push_back('B');
                }
            }
            else if (b == 0) {
                b++; c--;
                ans.push_back('B');
            }
            else if (c <= b) {
                b--; c++;
                ans.push_back('C');
            }
            else {
                b++; c--;
                ans.push_back('B');
            }
        }
        else {
            if (i != n - 1 && c == 1 && a == 1) {
                if (ss[i + 1] == "AB") {
                    c--; a++;
                    ans.push_back('A');
                }
                else {
                    c++; a--;
                    ans.push_back('C');
                }
            }
            else if (c == 0) {
                c++; a--;
                ans.push_back('C');
            }
            else if (a <= c) {
                c--; a++;
                ans.push_back('A');
            }
            else {
                c++; a--;
                ans.push_back('C');
            }
        }
        if (a < 0 || b < 0 || c < 0) {
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    rep(i, n) cout<<ans[i]<<endl;
}

Measured memory_bytes: 6636