//AUTHOR: RAVAN_2070
//PUNE INSTITUTE OF COMPUTER TECHNOLOGY
/*
    I LOVE CLARICE STARLING

     ♥LOVE♥        ♥LOVE♥
  ♥LOVE♥♥LOVE♥  ♥LOVE♥♥LOVE♥
♥LOVE♥♥LOVE♥♥LOVE♥♥LOVE♥♥LOVE♥
   ♥LOVE♥♥LOVE♥♥LOVE♥♥LOVE♥
      ♥LOVE♥♥LOVE♥♥LOVE♥
         ♥LOVE♥♥LOVE♥
            ♥LOVE♥
               ♥


EXPLAINATION BELOW->
Greedy

It can be easily shown if one value is greater than the other, it's safe to increase the min value. Our only concern is when both values are equal to 1, that way one of them will become a zero, we need to know which one to increase. The choice is based on which value will be used again first. 
Same example as the last comments : A = 1, B = 1 and C = 0 it will depend on the order.
Suppose the order is : AB then BC, if we increase A our solution will fail.
And if the order is : AB then AC then if we increase B our solution will fail too.
It is clear that we need to increment the value that comes next first in that case.


if a=b=1 and AB and next BC
now if we make a=2,b=0
so
if c>0 then no issues
 but in case if c is also 0
so as BC c=b=0 then problem

but if you had made a=0,b=2;
even if c==0
now with BC b=1,c=1 so both now safe     

*/
//After each choice, none of A, B, and C should be negative.
//F-Three Variables Game
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<pair<ll,ll>> vii;
typedef pair<ll,ll> pii;
typedef map<ll,ll> mii;
#define MOD7 1000000007
#define MOD9 1000000009
#define pi 3.1415926535
#define Test_cases ll TC;cin>>TC;while(TC--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed<<setprecision(x)
#define sz(x) (ll)(x.size())
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
void solve()
{
   int n,i;cin>>n;
   ll a,b,c;cin>>a>>b>>c;
   vector<string>s(n+1);
   fo(i,0,n)cin>>s[i];
   s[n]="DD";
   string ans,next;
   fo(i,0,n)
   {
       next=s[i+1];
       if(s[i]=="AB")
       {
            if(a<b||a==1&&a==b&&next=="AC")
            a++,b--,ans+="A\n";
            else
            b++,a--,ans+="B\n";
       }
       else if(s[i]=="BC")
            {
                if(b<c||b==1&&b==c&&next=="AB")
                b++,c--,ans+="B\n";
                else
                c++,b--,ans+="C\n";
            }
            else
            {
                if(c<a||c==1&&c==a&&next=="BC")
                c++,a--,ans+="C\n";
                else
                a++,c--,ans+="A\n";
            }
            
      if(a<0||b<0||c<0)
      {
          cout<<"No\n";
          return;
      }
   }
   cout<<"Yes\n";
   cout<<ans;
}
int main()
{
   fastio
   solve();
  return 0;
}
//map<ll,ll,greater<int>> to sort in descending order ,in iterator declaration no greater<int>
//if you want to apply lowerbound on set use s.lower_bound(key),not the one used for vector
/* TIPS FOR DEBUGGING
 * Check if values are not overflowing (use long long where required)
 * Check if ranges are inclusive or not.
 * Check properly if greedy will work or not before using it.
 * Check EDGE CASES!! Seriously, even in 2B, saving 8 points by being
 * 2 minutes faster will bite you in the ass if you don't make sure
 * it works on edge cases.
 * Keep adding to this list.
*/

/*  EXPLAINATION BELOW->
    We are considering j > i so we need to find all i and j such that
    j - i = a[j] + a[i] which is a[j] - j = - a[i] - i
    so for each j we need find count all of those whose value - a[i] - i is equal to a[j] -j. 
    We can use a map to store values of - a[i] - i and add it to our answer in each step for value a[j] - j.

void solve()
{
   int n,i;cin>>n;
   ll A[n],ans=0;
   map<ll,int>M; 
   foe(i,1,n)
   {
       cin>>A[i-1];
       ans+=M[A[i-1]-i];//performed in this loop itself because we are checking j,i where j>i;
       M[-A[i-1]-i]++;
   }
   cout<<ans<<"\n";
   
}
*/
/*#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>

inline void read(int &T) {
	int x=0;bool f=0;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=!f;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	T=f?-x:x;
}

int n,a,b,c;
char ans[100001];
std::string cmd[100001];

void dfs(int step,int a,int b,int c) {
	if(step>n) {
		puts("Yes");
		for(int i=1;i<=n;++i) {
			printf("%c\n",ans[i]);
		}
		exit(0);
	}
	if(cmd[step]=="AB") {
		if(a) {
			ans[step]='B';
			dfs(step+1,a-1,b+1,c);
		}
		if(b) {
			ans[step]='A';
			dfs(step+1,a+1,b-1,c);
		}
	}
	if(cmd[step]=="AC") {
		if(a) {
			ans[step]='C';
			dfs(step+1,a-1,b,c+1);
		}
		if(c) {
			ans[step]='A';
			dfs(step+1,a+1,b,c-1);
		}
	}
	if(cmd[step]=="BC") {
		if(b) {
			ans[step]='C';
			dfs(step+1,a,b-1,c+1);
		}
		if(c) {
			ans[step]='B';
			dfs(step+1,a,b+1,c-1);
		}
	}
}

int main() {
	read(n),read(a),read(b),read(c);
	for(int i=1;i<=n;++i) std::cin>>cmd[i];
	dfs(1,a,b,c);puts("No");
	return 0;
}*/

Measured memory_bytes: 6752