#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define    endl        '\n'
#define mii         map<ll int,ll int>
#define msi         map<string,ll int>
#define mis         map<ll int, string>
#define rep(i,a,b)    for(ll int i=a;i<b;i++)
#define repp(i,a,b)    for(ll int i=b-1;i>=a;i--)
#define tr(container,it) for(__typeof__(container.begin()) it = container.begin(); it != container.end(); it++)
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define mpi         map<pair<ll int,ll int>,ll int>
#define vii         vector<pair<ll,pair<ll,ll> > >
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        998244353
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
using namespace std;
#define N  10000
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";



void solve(){
	ll n,a,b,c;
	cin>>n>>a>>b>>c;
	vs v(n);
	rep(i,0,n) cin>>v[i];
	if(a+b+c==0){
		cout<<"No\n";
		return;
	}
	if(a+b+c==1){
		vector<char> an;
		rep(i,0,n){
			if(v[i]=="AB"&&c){
				cout<<"No\n";
				return;
			}
			if(v[i]=="BC"&&a){
				cout<<"No\n";
				return;
			}
			if(v[i]=="AC"&&b){
				cout<<"No\n";
				return;
			}
			if(v[i]=="AB"){
				if(a) an.pb('B');
				if(b) an.pb('A');
				swap(a,b);	
			}
			if(v[i]=="BC"){
				if(b) an.pb('C');
				if(c) an.pb('B');
				swap(c,b);	
			}
			if(v[i]=="AC"){
				if(a) an.pb('C');
				if(c) an.pb('A');
				swap(a,c);	
			}
		}
		cout<<"Yes\n";
		rep(i,0,n) cout<<an[i]<<endl;
		return;
	}
	if(a+b+c==2){
		vector<char> an;
		rep(i,0,n){
			if(v[i]=="AB"&&a==0&&b==0){
				cout<<"No";
				return;
			}
			if(v[i]=="AC"&&a==0&&c==0){
				cout<<"No";
				return;
			}
			if(v[i]=="BC"&&c==0&&b==0){
				cout<<"No";
				return;
			}
			if(v[i]=="AB"){
				if(a==0){
					a++;
					b--;
					an.pb('A');
				}
				else if(b==0){
					a--;
					b++;
					an.pb('B');
				}
				else{
					if(i<n-1&&v[i+1][0]=='A'){
						an.pb('A');
						a++;
						b--;
					}
					else{
						an.pb('B');
						a--;
						b++;
						
					}
				}

			}
			if(v[i]=="AC"){
				if(a==0){
					a++;
					c--;
					an.pb('A');
				}
				else if(c==0){
					a--;
					c++;
					an.pb('C');
				}
				else{
					if(i<n-1&&v[i+1][0]=='A'){
						an.pb('A');
						a++;
						c--;
					}
					else{
						an.pb('C');
						a--;
						c++;
						
					}
				}
			}
			if(v[i]=="BC"){
				if(c==0){
					c++;
					b--;
					an.pb('C');
				}
				else if(b==0){
					c--;
					b++;
					an.pb('B');
				}
				else{
					if(i<n-1&&v[i+1][1]=='C'){
						an.pb('C');
						c++;
						b--;
					}
					else{
						an.pb('B');
						c--;
						b++;		
					}
				}
			}
		}
		cout<<"Yes\n";
		rep(i,0,n) cout<<an[i]<<endl;
		return;
	}
	if(v[0]=="AB"&&a==0&&b==0){
		cout<<"No";
		return;
	}
	if(v[0]=="AC"&&a==0&&c==0){
		cout<<"No";
		return;
	}
	if(v[0]=="BC"&&c==0&&b==0){
		cout<<"No";
		return;
	}
	cout<<"Yes\n";
	rep(i,0,n){
		if(v[i]=="AB"){
			if(a>b){
				cout<<"B\n";
				b++;
				a--;
			}
			else{
				cout<<"A\n";
				b--;
				a++;
			}
		}
		if(v[i]=="AC"){
			if(a>c){
				cout<<"C\n";
				c++;
				a--;
			}
			else{
				cout<<"A\n";
				c--;
				a++;
			}
		}
		if(v[i]=="BC"){
			if(c>b){
				cout<<"B\n";
				b++;
				c--;
			}
			else{
				cout<<"C\n";
				b--;
				c++;
			}
		}
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll TESTS=1,an=1,f;
    // cin>>TESTS;
    while(TESTS--){
        // cout<<"Case #"<<an<<": ";
        an++;
        solve();

    }
    return 0;
}

Measured memory_bytes: 6636