//#include <ext/pb_ds/assoc_container.hpp> 
 //#include <ext/pb_ds/tree_policy.hpp>
// #include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <iterator>
#include <functional>
#include <limits>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <stack>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define trace(x) cerr << #x << ": " << x << " " << endl;

typedef int64_t ll;
 
#define endl '\n'
#define int ll
ll mod=1e17;
ll mod1=1e9+5;
ll power(ll a,ll b)
{
    if(b==0) return 1;
    else if(b%2==0)
        return power(((((a)%mod)*((a)%mod))%mod),b/2)%mod;
    else return (((a)%mod)*(power(((((a)%mod)*((a)%mod))%mod),b/2)%mod))%mod;
}
inline ll inverse(ll a,ll md) {
  a %= md;
  if (a < 0) a += md;
  ll b = md, u = 0, v = 1;
  while (a) {
    ll t = b / a;
    b -= t * a; swap(a, b);
    u -= t * v; swap(u, v);
  }
  assert(b == 1);
  if (u < 0) u += md;
  return u;
}
  
  
 //using namespace __gnu_pbds;
 //#define ordered_set tree<pair<int,int>, null_type,less<pair<int,int>>, rb_tree_tag,tree_order_statistics_node_update>
//find_by_order(k)  returns iterator to kth element starting from 0;
//order_of_key(k) returns count of elements strictly smaller than k;
//erase,insert same as normal set
// mt19937 mrand(chrono::high_resolution_clock::now().time_since_epoch().count()); for randomized solution
const int ce=1e9+7;
ll fast_mod(ll input)
{
    return input < ce ? input : input%ce;
}
#define pi acos(-1)
int n,a,b,c;
vector<string> s;
int go[100000][7][7][7][4];
int dp[100000][7][7][7];
int solve(int i,int x,int y,int z)
{
    if(x<0 or y<0 or z<0)
        return 0;
    if(i==n)
        return 1;
    int &res=dp[i][x][y][z];
    if(res!=-1)
        return res;
    res=0;
    if(s[i]=="AB")
    {
        res|=solve(i+1,x-1,y+1,z);
        if(res==1)
        {
            go[i][x][y][z][0]=i+1;
            go[i][x][y][z][1]=x-1;
            go[i][x][y][z][2]=y+1;
            go[i][x][y][z][3]=z;
            return res;
        }
        res|=solve(i+1,x+1,y-1,z);
        if(res==1)
        {
            go[i][x][y][z][0]=i+1;
            go[i][x][y][z][1]=x+1;
            go[i][x][y][z][2]=y-1;
            go[i][x][y][z][3]=z;
            return res;
        }
    }
    if(s[i]=="BC")
    {
        res|=solve(i+1,x,y+1,z-1);
        if(res==1)
        {
            go[i][x][y][z][0]=i+1;
            go[i][x][y][z][1]=x;
            go[i][x][y][z][2]=y+1;
            go[i][x][y][z][3]=z-1;
            return res;
        }
        res|=solve(i+1,x,y-1,z+1);
        if(res==1)
        {
            go[i][x][y][z][0]=i+1;
            go[i][x][y][z][1]=x;
            go[i][x][y][z][2]=y-1;
            go[i][x][y][z][3]=z+1;
            return res;
        }
    }
    if(s[i]=="AC")
    {
        res|=solve(i+1,x-1,y,z+1);
        if(res==1)
        {
            go[i][x][y][z][0]=i+1;
            go[i][x][y][z][1]=x-1;
            go[i][x][y][z][2]=y;
            go[i][x][y][z][3]=z+1;
            return res;
        }
        res|=solve(i+1,x+1,y,z-1);
        if(res==1)
        {
            go[i][x][y][z][0]=i+1;
            go[i][x][y][z][1]=x+1;
            go[i][x][y][z][2]=y;
            go[i][x][y][z][3]=z-1;
            return res;
        }
    }
    return res;
}
int32_t main()
{
    IOS

    
    cin>>n>>a>>b>>c;
    a=min(a,(ll)6);
    b=min(b,(ll)6);
    c=min(c,(ll)6);
    memset(dp,-1,sizeof(dp));
    for(int i=0;i<n;i++)
    {
        string s1;
        cin>>s1;
        s.push_back(s1);
    }
    if(solve(0,a,b,c))
    {
        cout<<"Yes"<<endl;
        int i=0,j=a,k=b,l=c;
        while(1)
        {
            if(i==n)
                break;
            int in=go[i][j][k][l][0];
            int x=go[i][j][k][l][1];
            int y=go[i][j][k][l][2];
            int z=go[i][j][k][l][3];
            if(s[i]=="AB")
            {
                if(x==j+1)
                {
                    cout<<"A"<<endl;
                }
                else
                {
                    cout<<"B"<<endl;
                }
            }
            if(s[i]=="AC")
            {
                if(x==j+1)
                {
                    cout<<"A"<<endl;
                }
                else
                {
                    cout<<"C"<<endl;
                }
            }
            if(s[i]=="BC")
            {
                if(y==k+1)
                {
                    cout<<"B"<<endl;
                }
                else
                {
                    cout<<"C"<<endl;
                }
            }
            i=in,j=x,k=y,l=z;
        }
    }
    else
    {
        cout<<"No"<<endl;

    }

    
}       


Measured memory_bytes: 683912