#include <bits/stdc++.h>
using namespace std;

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);i--)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll) 1e9 + 7;
//constexpr long long MOD = 998244353LL;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve(){
    ll n,a,b,c;
    cin>>n>>a>>b>>c;
    vec<string> s(n);
    REP(i,n) cin>>s[i];
    vec<string> ans(n);
    vec<ll> rab,rbc,rca;//決まってないリスト

    REP(i,n){
        if(s[i]=="AB"){
            if(a==0 && b==0) {
                if(rab.size()){
                    //ABで調整
                    ans[rab.back()] = "A";
                    ans[i] = "B";
                    a++;
                    b++;
                    rab.pop_back();
                }else if(rca.size()){
                    //C->Aで調整
                    ans[rca.back()] = "A";
                    ans[i] = "B";
                    a++;
                    b++;
                    rca.pop_back();
                }else if(rbc.size()){
                    //C->Bで調整
                    ans[rbc.back()] = "B";
                    ans[i] = "A";
                    b++;
                    a++;
                    rbc.pop_back();
                }else{
                    //調整不可能
                    cout<<"No"<<en;
                    return;
                }
            }else if(a!=0 && b!=0){
                a--;b--;
                rab.push_back(i);
            }else if(a<b){
                a++;
                b--;
                ans[i]="A";
            }else{
                a--;
                b++;
                ans[i]="B";
            }
        }else if(s[i]=="BC"){
            if(c==0 && b==0) {
                if(rbc.size()){
                    //BCで調整
                    ans[rbc.back()] = "C";
                    ans[i] = "B";
                    c++;
                    b++;
                    rbc.pop_back();
                }else if(rca.size()){
                    //A->Cで調整
                    ans[rca.back()] = "C";
                    ans[i] = "B";
                    b++;
                    c++;
                    rca.pop_back();
                }else if(rab.size()){
                    //A->Bで調整
                    ans[rab.back()] = "B";
                    ans[i] = "C";
                    b++;
                    c++;
                    rab.pop_back();
                }else{
                    //調整不可能
                    cout<<"No"<<en;
                    return;
                }
            }else if(c!=0 && b!=0){
                c--;b--;
                rbc.push_back(i);
            }else if(c<b){
                c++;
                b--;
                ans[i]="C";
            }else{
                c--;
                b++;
                ans[i]="B";
            }
        }else{
            if(c==0 && a==0) {
                if(rca.size()){
                    //ACで調整
                    ans[rca.back()] = "C";
                    ans[i] = "A";
                    c++;
                    a++;
                    rca.pop_back();
                }else if(rbc.size()){
                    //B->Cで調整
                    ans[rbc.back()] = "C";
                    ans[i] = "A";
                    c++;
                    a++;
                    rbc.pop_back();
                }else if(rab.size()){
                    //B->Aで調整
                    ans[rab.back()] = "A";
                    ans[i] = "C";
                    c++;
                    a++;
                    rab.pop_back();
                }else{
                    //調整不可能
                    cout<<"No"<<en;
                    return;
                }
            }else if(c!=0 && a!=0){
                c--;a--;
                rca.push_back(i);
            }else if(c<a){
                c++;
                a--;
                ans[i]="C";
            }else{
                c--;
                a++;
                ans[i]="A";
            }
        }
        //cout<<a<<" "<<b<<" "<<c<<en;
    }

    for(auto i:rab) ans[i]="A";
    for(auto i:rbc) ans[i]="B";
    for(auto i:rca) ans[i]="C";

    cout<<"Yes"<<en;
    for(auto i:ans)cout<<i<<en;
}

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

    solve();
    //ll t;cin>>t;REP(i,t) solve();

    return 0;
}


Measured memory_bytes: 10728