//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set <int>
#define sll set <ll>
#define spii set <pii>
#define vs vector <string>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define mp make_pair
#define vvll vector <vll>
#define vsi vector <si>
#define forn(i, n) for (int i = 0; i < (n); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()


const ll INFLL = 1e18;
const int MAXN = 1e5+100;
const ll INF = 1e9;
const ll mod1=1e9+7;
const ll mod2=2e9+11;
vector <char> ans;
bool dp[MAXN][27];
pair <int,char> was[MAXN][27];
int n;
void out()
{
    cout<<"Yes\n";
    for (auto to:ans)
        cout<<to<<'\n';
    bool ac=false,bc=false,ab=false;
    while (n--)
    {
        string s;
        cin>>s;
        if (s=="AB")
        {
            if (ab)
            {
                cout<<"A\n";
                ab=false;
            } else
            {
                cout<<"B\n";
                ab=true;
            }
        }
        else
        {
            if (s=="AC")
            {
                if (ac)
                {
                    cout<<"C\n";
                    ac=false;
                }
                else
                {
                    cout<<"A\n";
                    ac=true;
                }
            }
            else
            {
                if (bc)
                {
                    cout<<"B\n";
                    bc=false;
                } else
                {
                    cout<<"C\n";
                    bc=true;
                }
            }
        }
    }
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("a.in","r",stdin);
#endif
    cin>>n;
    ll a,b,c;
    cin>>a>>b>>c;
    if (a==0&&b==0&&c==0)
    {
        cout<<"No";
        return 0;
    }
    if (a>0&&b>0&&c>0)
    {
        cout<<"Yes\n";
        bool ac=false,bc=false,ab=false;
        while (n--)
        {
            string s;
            cin>>s;
            if (s=="AB")
            {
                if (ab)
                {
                    cout<<"A\n";
                    ab=false;
                } else
                {
                    cout<<"B\n";
                    ab=true;
                }
            }
            else
            {
                if (s=="AC")
                {
                    if (ac)
                    {
                        cout<<"C\n";
                        ac=false;
                    }
                    else
                    {
                        cout<<"A\n";
                        ac=true;
                    }
                }
                else
                {
                    if (bc)
                    {
                        cout<<"B\n";
                        bc=false;
                    } else
                    {
                        cout<<"C\n";
                        bc=true;
                    }
                }
            }
        }
        return 0;
    }
    bool ok=true;
//    vector <string> sss;
//    while (n--)
//    {
//        string ss;
//        cin>>ss;
//        sss.pb(ss);
//    }
//    vector <pair <string,int> > s;
//    int i=0;
//    while (i<sss.size())
//    {
//        int j=i;
//        int cnt=0;
//        while (j<sss.size()&&sss[i]==sss[j])
//            cnt++,j++;
//        s.pb({sss[i],cnt});
//        i=j;
//    }
    if (a+b+c>=3)
    {
        while (n--)
        {
            string s;
            cin>>s;
            if (s=="AC")
            {
                if (a==0&&c==0)
                {
                    cout<<"No";
                    return 0;
                }
                else
                {
                    if (a+c==1) {
                        if (a > 0)
                            ans.pb('C'), a--, c++;
                        else
                            ans.pb('A'), a++, c--;
                    }
                    else
                    {
                        if (a==0)
                        {
                            ans.pb('A'),a++,c--;
                        } else
                        {
                            if (c==0)
                                ans.pb('C'),c++,a--;
                            else
                            {
                                if (a>1)
                                    ans.pb('C'),c++,a--;
                                else
                                    ans.pb('A'),a++,c--;
                            }
                        }
                    }
                    if (a>0&&b>0&&c>0)
                    {
                       out();
                       return 0;
                    }
                }
            }
            else
            {
                if (s=="AB")
                {
                    if (a==0&&b==0)
                    {
                        cout<<"No";
                        return 0;
                    }
                    else
                    {
                        if (a+b==1) {
                            if (a > 0)
                                ans.pb('B'), a--, b++;
                            else
                                ans.pb('A'), a++, b--;
                        }
                        else
                        {
                            if (a==0)
                            {
                                ans.pb('A'),a++,b--;
                            } else
                            {
                                if (b==0)
                                    ans.pb('B'),b++,a--;
                                else
                                {
                                    if (a>1)
                                        ans.pb('B'),b++,a--;
                                    else
                                        ans.pb('A'),a++,b--;
                                }
                            }
                        }
                        if (a>0&&b>0&&c>0)
                        {
                            out();
                            return 0;
                        }
                    }
                }
                else
                {
                    if (c==0&&b==0)
                    {
                        cout<<"No";
                        return 0;
                    }
                    else
                    {
                        if (c+b==1) {
                            if (c > 0)
                                ans.pb('B'), c--, b++;
                            else
                                ans.pb('C'), c++, b--;
                        }
                        else
                        {
                            if (c==0)
                            {
                                ans.pb('C'),c++,b--;
                            } else
                            {
                                if (b==0)
                                    ans.pb('B'),b++,c--;
                                else
                                {
                                    if (c>1)
                                        ans.pb('B'),b++,c--;
                                    else
                                        ans.pb('C'),c++,b--;
                                }
                            }
                        }
                        if (a>0&&b>0&&c>0)
                        {
                            out();
                            return 0;
                        }
                    }
                }
            }
        }
        cout<<"Yes\n";
        for (auto to:ans)
            cout<<to<<'\n';
        return 0;
    }
    if (a+b+c==1)
    {
        while (n--)
        {
            string s;
            cin>>s;
            if (s=="AC")
            {
                if (a==0&&c==0)
                {
                    cout<<"No";
                    return 0;
                }
                else
                {
                    if (a>0)
                        ans.pb('C'),a--,c++;
                    else
                        ans.pb('A'),a++,c--;
                }
            }
            else
            {
                if (s=="AB")
                {
                    if (a==0&&b==0)
                    {
                        cout<<"No";
                        return 0;
                    }
                    else
                    {
                        if (a>0)
                            ans.pb('B'),a--,b++;
                        else
                            ans.pb('A'),a++,b--;
                    }
                }
                else
                {
                    if (c==0&&b==0)
                    {
                        cout<<"No";
                        return 0;
                    }
                    else
                    {
                        if (c>0)
                            ans.pb('B'),c--,b++;
                        else
                            ans.pb('C'),c++,b--;
                    }
                }
            }
        }
        cout<<"Yes\n";
        for (auto to:ans)
            cout<<to<<'\n';
        return 0;
    }
    dp[0][a*9+b*3+c]=true;
    for (int i=1;i<=n;i++)
    {
        string s;
        cin>>s;
        for (int j=0;j<27;j++)
        {
            if (dp[i-1][j])
            {
                int w=j;
                int z=w%3;
                w/=3;
                int y=w%3;
                w/=3;
                int x=w%3;
                if (s=="AC")
                {
                    if (x+z>0)
                    {
                        if (x>0)
                            dp[i][(x-1)*9+y*3+(z+1)]=true,was[i][(x-1)*9+y*3+(z+1)]={j,'C'};
                        if (z>0)
                            dp[i][(x+1)*9+y*3+(z-1)]=true,was[i][(x+1)*9+y*3+(z-1)]={j,'A'};
                    }
                }
                else
                {
                    if (s=="AB")
                    {
                        if (x+y>0)
                        {
                            if (x>0)
                                dp[i][(x-1)*9+(y+1)*3+z]=true,was[i][(x-1)*9+(y+1)*3+z]={j,'B'};
                            if (y>0)
                                dp[i][(x+1)*9+(y-1)*3+z]=true,was[i][(x+1)*9+(y-1)*3+z]={j,'A'};
                        }
                    }
                    else
                    {
                        if (y+z>0)
                        {
                            if (y>0)
                                dp[i][x*9+(y-1)*3+(z+1)]=true,was[i][x*9+(y-1)*3+(z+1)]={j,'C'};
                            if (z>0)
                                dp[i][x*9+(y+1)*3+(z-1)]=true,was[i][x*9+(y+1)*3+(z-1)]={j,'B'};
                        }
                    }
                }
            }
        }
    }
    int ind=-1;
    for (int i=0;i<27;i++)
    {
        if (dp[n][i])
            ind=i;
    }
    if (ind==-1)
    {
        cout<<"No";
        return 0;
    }
    cout<<"Yes\n";
    for (int i=n;i>0;i--)
    {
        ans.pb(was[i][ind].se);
        ind=was[i][ind].fi;
    }
    reverse(all(ans));
    for (auto to:ans)
        cout<<to<<'\n';
//    if (ok)
//    {
//        cout<<"Yes\n";
//        for (auto to:ans)
//            cout<<to<<'\n';
//        return 0;
//    } else
//        cout<<"No\n";





}

Measured memory_bytes: 27536