/*
 ABC-166
 */
#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
//#define int long long int
typedef complex<long double> cd;
const long double pi=acos(-1);
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <db, db> pdd;
typedef vector<int> vi;
typedef vector<vector<int> > matrix;

#define m1 make_pair
#define pb push_back
#define flush fflush(stdout)
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define reset(x,v) memset(x,v,sizeof(x))

#define fi first
#define se second
#define endl "\n"
#define debug(x) (cerr << #x << ": " << x << "\n")
#define setbits(x) __builtin_popcount(x)
#define setbitsll(x) __builtin_popcountll(x)
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
#define mt make_tuple
#define  node tuple<int,int,int,int>
inline ll gcd(ll a,ll b){if(a==0) return b;return gcd(b%a,a);}
inline ll power(ll a,ll n,ll m){if(n==0)return 1;ll p=power(a,n/2,m);p=(p%m*p%m)%m;if(n%2) return (p%m*a%m)%m;else return p;}
const ll MOD =998244353;
const ll hell=1000000007;
const int INF = 1e7;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

double startTime;
double getCurrentTime() {
    return ((double)clock() - startTime) / CLOCKS_PER_SEC;
}

const int N=100005;

int n;
string s[N];

map<node,bool>mp;ll sum;

bool solve(int i,int a,int b,int c)
{
    if(a<0||b<0||c<0)
        return 0;
    else if(mp.find(mt(i,a,b,c))!=mp.end())
        return mp[mt(i,a,b,c)];
    else if(i==n)
    {
        return mp[mt(i,a,b,c)]=1;
    }
    bool z=0;
    if(s[i]=="AB")
    {
        
        z=solve(i+1,a+1,b-1,c);
        z=z|solve(i+1,a-1,b+1,c);
    }
    else if(s[i]=="BC")
    {
        z=solve(i+1,a,b+1,c-1);
        z=z|solve(i+1,a,b-1,c+1);
    }
    else
    {
        z=solve(i+1,a+1,b,c-1);
        z=z|solve(i+1,a-1,b,c+1);
    }
     mp[mt(i,a,b,c)]=z;
    return z;
}
void print(int i,int a,int b,int c)
{
    if(i==n)
    {
        return;
    }
    node n1,n2;
    if(s[i]=="AB")
    {
        n1=mt(i+1,a-1,b+1,c);
        n2=mt(i+1,a+1,b-1,c);
        if(a>=1&&mp[n1])
        {
            cout<<"B"<<endl;
            print(i+1,a-1,b+1,c);
        }
        else
        {
            cout<<"A"<<endl;
            print(i+1,a+1,b-1,c);
        }
    }
    else if(s[i]=="BC")
    {
        n1=mt(i+1,a,b+1,c-1);
        n2=mt(i+1,a,b-1,c+1);
        if(c>=1&&mp[n1]==1)
        {
            cout<<"B"<<endl;
            print(i+1,a,b+1,c-1);
        }
        else
        {
            cout<<"C"<<endl;
            print(i+1,a,b-1,c+1);
        }
    }
    else
    {
        n1=mt(i+1,a-1,b,c+1);
        n2=mt(i+1,a+1,b,c-1);
        if(a>=1&&mp[n1]==1)
        {
            cout<<"C"<<endl;
            print(i+1,a-1,b,c+1);
        }
        else
        {
            cout<<"A"<<endl;
            print(i+1,a+1,b,c-1);
        }
    }
}
void solve()
{
    cin>>n;
    
    int a,b,c;
    cin>>a>>b>>c;
    for(int i=0;i<n;i++)
        cin>>s[i];
    int cnt[3];
    cnt[0]=a;cnt[1]=b;cnt[2]=c;
    int A[3];
    A[0]=a;A[1]=b;A[2]=c;
    sort(A,A+3);
    if(A[0]>=n)
    {
        cout<<"Yes"<<endl;
        for(int i=0;i<n;i++)
        {
            cout<<s[i][0]<<endl;
            //cout<<endl;
        }
        return;
        
    }
    else if(A[1]>=n)
    {
        cout<<"Yes"<<endl;
        for(int i=0;i<n;i++)
        {
            if(cnt[s[i][0]-'A']<n)
            {
                cout<<s[i][0]<<endl;
            }
            else
                cout<<s[i][1]<<endl;
        }
        return;
    }
    else if(A[2]>=n)
    {
        int re=0;
        for(int i=0;i<=2;i++)
            if(cnt[i]==A[2])
                re=i;
       // cout<<re<<endl;
        int poss=1;vector<char>ans;
        for(int i=0;i<n;i++)
        {
            int z1=s[i][0]-'A',z2=s[i][1]-'A';
            if(z1==re)
            {
                ans.pb(s[i][1]);
                cnt[z2]+=1;
            }
            else if(z2==re)
            {
                ans.pb(s[i][0]);
                cnt[z1]+=1;
            }
            else
            {
                if(cnt[z1]>cnt[z2])
                {
                    cnt[z1]-=1;cnt[z2]+=1;
                    ans.pb(s[i][1]);
                }
                else
                {
                    cnt[z1]+=1;cnt[z2]-=1;
                    ans.pb(s[i][0]);
                }
            }
            if(cnt[z1]<0||cnt[z2]<0)
            {
                poss=0;break;
            }
        }
        if(poss)
        {
            cout<<"Yes"<<endl;
            for(char ch:ans)
                cout<<ch<<endl;
        }
        else
            cout<<"No"<<endl;
        return;
        
    }
    sum=a+b+c;
    
    bool z=solve(0,a,b,c);
    if(z)
    {
        cout<<"Yes"<<endl;
        print(0,a,b,c);
        // cout<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    
}

int32_t main()
{
    IOS;
    // startTime=clock();
    int t;
    t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
    // cout<<getCurrentTime()<<endl;
    return 0;
}




Measured memory_bytes: 37972