#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n) for(ll i=0;i<(n);++i)
#define REPR(i,n) for(ll i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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 (a > b) { a = b; return 1; } return 0; }

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

char simulate(ll a, ll b, ll c, string s) {
    if (s=="AB") {
        // dec to A
        if (a-1 >= 0) return 'A';
        // dec to B
        if (b-1 >= 0) return 'B';
    }
    else if (s=="BC") {
        // dec to B
        if (b-1>=0) return 'B';
        // dec to C
        if (c-1>=0) return 'C';
    }
    else {
        // dec to A
        if (a-1>=0) return 'A';
        // dec to C
        if (c-1>=0) return 'C';
    }
    return 'F';
}

int main(int argc, char const *argv[]) {
    ll n,a,b,c; cin>>n>>a>>b>>c;
    vector<string> s(n);
    rep(i,n) cin>>s[i];
    vector<char> ans(n);

    auto fail = []() {
        cout << "No" << '\n';
        exit(0);
    };

    rep(i,n) {
        if (s[i]=="AB") {
            ll na = a; ll nb = b; na++; nb--;
            if (na>=0 && nb>=0) {
                if (i != n-1) {
                    if (simulate(na,nb,c,s[i+1]) != 'F') {
                        a++; b--;
                        ans[i] = 'A';
                        continue;
                    }
                }
                else {
                    a++; b--;
                    ans[i] = 'A';
                    continue;
                }
            }

            na = a; nb = b; --na,++nb;
            if (na>=0 && nb>=0) {
                if (i != n-1) {
                    if (simulate(na,nb,c,s[i+1]) != 'F') {
                        a--; b++;
                        ans[i] = 'B';
                        continue;
                    }
                }
                else {
                    a--; b++;
                    ans[i] = 'B';
                    continue;
                }
            }

            fail();
        }
        else if (s[i]=="BC") {
            ll nb = b; ll nc = c; nb++; nc--;
            if (nb>=0 && nc>=0) {
                if (i != n-1) {
                    if (simulate(a,nb,nc,s[i+1]) != 'F') {
                        b++; c--;
                        ans[i] = 'B';
                        continue;
                    }
                }
                else {
                    b++; c--;
                    ans[i] = 'B';
                    continue;
                }
            }

            nb = b; nc = c; --nb,++nc;
            if (nb>=0 && nc>=0) {
                if (i != n-1) {
                    if (simulate(a,nb,nc,s[i+1]) != 'F') {
                        b--; c++;
                        ans[i] = 'C';
                        continue;
                    }
                }
                else {
                    b--; c++;
                    ans[i] = 'C';
                    continue;
                }
            }

            fail();
        }
        else if (s[i] == "AC") {
            ll na = a; ll nc = c; na++; nc--;
            if (na>=0 && nc>=0) {
                if (i != n-1) {
                    if (simulate(na,b,nc,s[i+1]) != 'F') {
                        a++; c--;
                        ans[i] = 'A';
                        continue;
                    }
                }
                else {
                    a++; c--;
                    ans[i] = 'A';
                    continue;
                }
            }

            na = a; nc = c; --na,++nc;
            if (na>=0 && nc>=0) {
                if (i != n-1) {
                    if (simulate(na,b,nc,s[i+1]) != 'F') {
                        a--; c++;
                        ans[i] = 'C';
                        continue;
                    }
                }
                else {
                    a--; c++;
                    ans[i] = 'C';
                    continue;
                }
            }

            fail();
        }
    }

    cout << "Yes" << '\n';
    for (auto &&e: ans) {
        cout << e << '\n';
    }
    return 0;
}

Measured memory_bytes: 6704