#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(ll i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
struct pair_hash {inline std::size_t operator()(const std::pair<ll, ll> & v) const {return v.first*31+v.second;}};
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC targett("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define pb push_back
#define fr first
#define sc second
#define prnt(m) for(auto it = m.begin() ; it != m.end() ; ++it){cout<<*it<<endl;}
#define tra(it,m) for(auto it=m.begin();it!=m.end();++it)
#define DBG(x) cout<<"# # #     "<<x<<'\n';
#define fri(i,s,n) for(ll i=s;i<n;i++)
#define mod 1000000007LL
#define mod2 998244353
#define vct2 vector<vector<ll>>
#define vct vector<ll>
#define pll pair<ll,ll>
#define rz(n) resize(n)
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define arrin(a,n) for(ll i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(ll i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl,exit(0);
#define inf 2e18
#define h_p 1110111110111;
#define five 100005;
#define six 1000005;
#define printclock cerr<<"Time "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
//_______________________________________________________________________________
const int N = five;
string q[N];
int dp[N][7][7][7];
int n;
bool f(int i,int a,int b,int c)
{
       if(a < 0 || b < 0 || c < 0 || a > 5 || b > 5 || c > 5)
       {
              return 0;
       }
       if(i == n){return 1;}
       if(dp[i][a][b][c] != -1){return dp[i][a][b][c];}
       if(q[i] == "AB")
       {
              dp[i][a][b][c] = f(i+1,a-1,b+1,c) | f(i+1,a+1,b-1,c);
       }
       else if(q[i] == "BC")
       {
              dp[i][a][b][c] = f(i+1,a,b+1,c-1) | f(i+1,a,b-1,c+1);
       }
       else
       {
              dp[i][a][b][c] = f(i+1,a-1,b,c+1) | f(i+1,a+1,b,c-1);
       }
       return dp[i][a][b][c];
}
vector<char> ans;
void ff(int i,int a,int b,int c)
{
       if(i == n)
       {return;}
       if(q[i] == "AB")
       {
              if(f(i+1,a-1,b+1,c))
              {
                     ans.pb('B');
                     ff(i+1,a-1,b+1,c);
              }
              else
              {
                     ans.pb('A');
                     ff(i+1,a+1,b-1,c);
              }

       }
       else if(q[i] == "BC")
       {
              if(f(i+1,a,b+1,c-1))
              {
                     ans.pb('B');
                     ff(i+1,a,b+1,c-1);
              }
              else
              {
                     ans.pb('C');
                      ff(i+1,a,b-1,c+1);
              }
       }
       else
       {
              if(f(i+1,a+1,b,c-1))
              {
                     ans.pb('A');
                     ff(i+1,a+1,b,c-1);
              }
              else
              {
                     ans.pb('C');
                      ff(i+1,a-1,b,c+1);
              }
       }
}
int main()
{
       int a,b,c;
       cin>>n>>a>>b>>c;
       vector<char> xx;
       arrin(q,n);
       bool fft = true;
       if(max({a,b,c}) >= 3){
              fri(i,0,n)
              {
                     if(q[i] == "AB")
                     {
                            if(a < b)
                            {
                                   a++;
                                   b--;
                                   xx.pb('A');
                            }
                            else
                            {
                                   a--;
                                   b++;
                                   xx.pb('B');
                            }
                     }
                     else if(q[i] == "BC")
                     {
                            if(b < c)
                            {
                                   b++;
                                   c--;
                                   xx.pb('B');
                            }
                            else
                            {
                                   b--;
                                   c++;
                                   xx.pb('C');
                            }
                     }
                     else
                     {
                            if(a < c)
                            {
                                   a++;
                                   c--;
                                   xx.pb('A');
                            }
                            else
                            {
                                   c++;
                                   a--;
                                   xx.pb('C');
                            }
                     }
                     if(a < 0 || b < 0 || c < 0){fft = false;}
              }
              if(fft)
              {
                     cout<<"Yes"<<endl;
                     for(char c : xx)
                     {
                            cout<<c<<endl;
                     }
              }
              else
              {
                     cout<<"No";
              }
       }
       else
       {
              memset(dp,-1,sizeof dp);
              if(f(0,a,b,c) == 0){
                     cout<<"No"<<endl;
              }
              else{
                     cout<<"Yes"<<endl;
                     ff(0,a,b,c);
                     for(char cc : ans)
                     {
                            cout<<cc<<endl;
                     }
              }
       }
}


Measured memory_bytes: 148692