#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define fi first
#define se second
#define endl "\n"
#define all(v) v.begin(),v.end()
#define fastio ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0)
#define go_t int t;cin>>t;for(int tt=1;tt<=t;tt++)
#define set_ar(arr,v) memset(arr,v,sizeof(arr))
#define trace2(x, y)             cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)          cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)       cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define trace5(a, b, c, d, e)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<endl;
typedef tree<pair<ll,ll>,null_type,less<pair<ll,ll>>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; // order_of_key
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const ll inf = 0x3f3f3f3f3f3f3f3fll;//4x10e18
const int maxx = 3000000 , mod = 1000000007;
#define PI 3.14159265
int n;
string s[100005];
vector<char>ans;
int dp[100005][8][8][8];
int solve(int idx,int a,int b,int c)
{
    if(idx>n)
    {
        if(a>=0 && b>=0 && c>=0)return 1;
        else return 0;
    }
    if(a<0 || b<0 || c<0)
        return 0;
    if(dp[idx][a][b][c]!=-1)
        return dp[idx][a][b][c];

    if(s[idx]=="AB")
    {
        if(a>b)
        {
            if(solve(idx+1,a-1,b+1,c))
            {
                ans.pb('B');
                return dp[idx][a][b][c] = 1;
            }
            else return dp[idx][a][b][c] = 0;
        }
        else if(b>a)
        {
            if(solve(idx+1,a+1,b-1,c))
            {
                ans.pb('A');
                return dp[idx][a][b][c] = 1;
            }
            else return dp[idx][a][b][c] = 0;
        }
        else
        {
            if(solve(idx+1,a-1,b+1,c))
            {
                ans.pb('B');
                return dp[idx][a][b][c] = 1;
            }
            else if(solve(idx+1,a+1,b-1,c))
            {
                ans.pb('A');
                return dp[idx][a][b][c] = 1;
            }
            else return dp[idx][a][b][c] = 0;
        }
    }
    else if(s[idx]=="AC")
    {
        if(a>c)
        {
            if(solve(idx+1,a-1,b,c+1))
            {
                ans.pb('C');
                return dp[idx][a][b][c] = 1;
            }
            else return dp[idx][a][b][c] = 0;
        }
        else if(c>a)
        {
            if(solve(idx+1,a+1,b,c-1))
            {
                ans.pb('A');
                return dp[idx][a][b][c] = 1;
            }
            else return dp[idx][a][b][c] = 0;
        }
        else
        {
            if(solve(idx+1,a-1,b,c+1))
            {
                ans.pb('C');
                return dp[idx][a][b][c] = 1;
            }
            else if(solve(idx+1,a+1,b,c-1))
            {
                ans.pb('A');
                return dp[idx][a][b][c] = 1;
            }
            else return dp[idx][a][b][c] = 0;
        }
    }
    else
    {
        if(c>b)
        {
            if(solve(idx+1,a,b+1,c-1))
            {
                ans.pb('B');
                return dp[idx][a][b][c] = 1;
            }
            else return dp[idx][a][b][c] = 0;
        }
        else if(b>c)
        {
            if(solve(idx+1,a,b-1,c+1))
            {
                ans.pb('C');
                return dp[idx][a][b][c] = 1;
            }
            else return dp[idx][a][b][c] = 0;
        }
        else
        {
            if(solve(idx+1,a,b+1,c-1))
            {
                ans.pb('B');
                return dp[idx][a][b][c] = 1;
            }
            else if(solve(idx+1,a,b-1,c+1))
            {
                ans.pb('C');
                return dp[idx][a][b][c] = 1;
            }
            else return dp[idx][a][b][c] = 0;
        }
    }
}
int main()
{
    fastio;
    int a,b,c;
    cin>>n>>a>>b>>c;
    set_ar(dp,-1);
    for(int i=1;i<=n;i++)cin>>s[i];
    a = min(4,a);
    b = min(4,b);
    c = min(4,c);
    int f = solve(1,a,b,c);
    if(!f)
    cout<<"No"<<endl;
    else 
    {
        cout<<"Yes"<<endl;
        reverse(all(ans));
        for(char c :ans)
        cout<<c<<endl;
    }
    return 0;
}

Measured memory_bytes: 219424