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

#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define ldb long double 
#define db double
#define int long long

#define fr first
#define se second
#define lb lower_bound 
#define ub upper_bound 
#define pb push_back
#define mpr make_pair

#define pi pair<int,int>
#define pdb pair<db,db>
#define pldb pair<ldb,ldb>

#define vi vector<int>
#define vdb vector<db>
#define vldb vector<ldb>
#define vpi vector< pi >

#define mi map<int,int>
#define mdb map<db,db>
#define mldb map<ldb,ldb>


#define forr(a,b) for (int i = (a); i < (b); ++i)
#define rrof(a,b) for (int i = (b)-1; i >= (a); --i)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

const int md = 1e9+7;
const int MX = 2e5+5;
const int INF = 1e18; 
const ldb PI = 4*atan((ldb)1);

int power_md(int a,int n)
{
 int res=1;
 while(n)
{
 if(n%2)
  res=(res%md*a%md)%md;
  a=(a%md*a%md)%md;
  n/=2;
}
res%=md;
return res;
}

int power(int a,int n)
{
 int res=1;
 while(n)
{
 if(n%2)
  res*=a;
  a=a*a;
  n/=2;
}
return res;
}

int abst(int a)
{
 return ((a<0)?(-1*a):(a));
}

class cmp_set{
public:
	bool operator() (int a, int b){
		return a > b;
	}
};

vector<string> vec_splitter(string s) {
	s += ',';
	vector<string> res;
	while(!s.empty()) {
		res.push_back(s.substr(0, s.find(',')));
		s = s.substr(s.find(',') + 1);
	}
	return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
	if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
	stringstream ss; ss << H;
	cerr << args[idx] << " = " << ss.str();
	debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif

int dp[100005][3][3][3],bt[100005][3][3][3];

int n,a,b,c;
vector< string > v;

int fun(int i,int ca,int cb,int cc)
{
    if(i==n)
    {
        return 1;
    }
    if(dp[i][ca][cb][cc]!=-1)
     return dp[i][ca][cb][cc];
    int res=0;
    int val;
    if(v[i]=="AB")
    {
       if(cb>0)
        res=max(res,fun(i+1,min((int)2,ca+1),cb-1,cc));
       if(res==1)
       {
           val=0;
       }
       if(ca>0&&res==0)
       {
        res=max(res,fun(i+1,ca-1,min((int)2,cb+1),cc));
        if(res==1)
        {
            val=1;
        } 
        }
    }
    else if(v[i]=="AC")
    {
        if(cc>0)
        res=max(res,fun(i+1,min((int)2,ca+1),cb,cc-1));
       if(res==1)
       {
           val=0;
       }
       if(ca>0&&res==0)
       {
        res=max(res,fun(i+1,ca-1,cb,min((int)2,cc+1)));
        if(res==1)
        {
            val=2;
        }
        } 
    }
    else
    {
       if(cb>0)
        res=max(res,fun(i+1,ca,cb-1,min((int)2,cc+1)));
       if(res==1)
       {
           val=2;
       }
       if(cc>0&&res==0)
       {
        res=max(res,fun(i+1,ca,min((int)2,cb+1),cc-1));
        if(res==1)
        {
            val=1;
        } 
        }
    }
    if(res==1)
    {
        bt[i][ca][cb][cc]=val;
    }
    return dp[i][ca][cb][cc]=res;
}

int32_t main()
{
    fast;
    memset(dp,-1,sizeof(dp));
    memset(dp,-1,sizeof(bt));
    cin>>n>>a>>b>>c;
    if(a>2)
     a=2;
     if(b>2)
      b=2;
      if(c>2)
       c=2;
    for(int i=0;i<n;i++)
    {
        string s;
        cin>>s;
        v.pb(s);
    }
    int f=fun(0,a,b,c);
    if(f)
    {
        cout<<"Yes\n";
        vector< char > res;
        int i=0;
        while(i<n)
        {
            int p=bt[i][a][b][c];
            char ch='A'+p;
            res.pb(ch);
            if(p==0)
            {
             a=min((int)2,a+1);
             if(v[i]=="AB")
              b--;
              else
               c--;
             }
            else if(p==1)
            {
             b=min((int)2,b+1);
             if(v[i]=="AB")
              a--;
              else
               c--;
             }
             else
             {
              c=min((int)2,c+1);
              if(v[i]=="AC")
               a--;
               else
                b--;
             }
             i++;
        }
        for(int j=0;j<res.size();j++)
         cout<<res[j]<<"\n";
    }
    else
    {
        cout<<"No\n";
        
    }
    return 0;
}

Measured memory_bytes: 53640