#include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define sz(v) (int) v.size()
#define pr(v) For(i, 0, sz(v)) {cout<<v[i]<<" ";} cout<<endl;
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(ll i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long
#define int long long
#define mp make_pair
#define F first
#define S second
typedef pair<int, int> pii;
typedef vector<int> vi;
#define MOD 1000000007
#define INF 1000000000000000007LL

const int N = 100005;

#define piii pair<int, pii>
 
// it's swapnil07 ;)
 
#ifdef SWAPNIL07
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif

string s;
string ss[N];

bool dp[N][5][5][5];
char pp[N][5][5][5];
piii lp[N][5][5][5];

int v1, v2;

void solve(){
    int n, a, b, c; cin>>n>>a>>b>>c;
    if(a > 4)
        a = 4;
    if(b > 4)
        b = 4;
    if(c > 4)
        c = 4;
    dp[0][a][b][c]=true;
    vector<char> ans;
    For(i, 0, n+1){
        cin>>s;
        ss[i]=s;
        For(j, 0, 5){
            For(k, 0, 5){
                For(l, 0, 5){
                    if(!dp[i][j][k][l])
                        continue;
                    if(s[0]=='A' && s[1]=='B'){
                        v1 = j-1;
                        v2 = min(k+1, 4LL);
                        if(v1 >= 0){
                            dp[i+1][v1][v2][l]=true;
                            pp[i+1][v1][v2][l]='B';
                            lp[i+1][v1][v2][l]={j, {k, l}};
                        }
                        v1 = min(j+1, 4LL);
                        v2 = k-1;
                        if(v2 >= 0){
                            dp[i+1][v1][v2][l]=true;
                            pp[i+1][v1][v2][l]='A';
                            lp[i+1][v1][v2][l]={j, {k, l}};
                        }
                    }
                    if(s[0]=='A' && s[1]=='C'){
                        v1 = j-1;
                        v2 = min(l+1, 4LL);
                        if(v1 >= 0){
                            dp[i+1][v1][k][v2]=true;
                            pp[i+1][v1][k][v2]='C';
                            lp[i+1][v1][k][v2]={j, {k, l}};
                        }
                        v1 = min(j+1, 4LL);
                        v2 = l-1;
                        if(v2 >= 0){
                            dp[i+1][v1][k][v2]=true;
                            pp[i+1][v1][k][v2]='A';
                            lp[i+1][v1][k][v2]={j, {k, l}};
                        }
                    }
                    if(s[0]=='B' && s[1]=='C'){
                        v1 = k-1;
                        v2 = min(l+1, 4LL);
                        if(v1 >= 0){
                            dp[i+1][j][v1][v2]=true;
                            pp[i+1][j][v1][v2]='C';
                            lp[i+1][j][v1][v2]={j, {k, l}};
                        }
                        v1 = min(k+1, 4LL);
                        v2 = l-1;
                        if(v2 >= 0){
                            dp[i+1][j][v1][v2]=true;
                            pp[i+1][j][v1][v2]='B';
                            lp[i+1][j][v1][v2]={j, {k, l}};
                        }
                    }
                }
            }
        }
    }
    int cur[3];
    memset(cur, -1, sizeof(cur));
    For(i, 0, 5){
        For(j, 0, 5){
            For(k, 0, 5){
                if(dp[n][i][j][k]){
                    cur[0]=i;
                    cur[1]=j;
                    cur[2]=k;
                }
            }
        }
    }
    if(cur[0]==-1){
        cout<<"No";
        return;
    }
    cout<<"Yes\n";
    for(int i=n; i>0; i--){
        ans.pb(pp[i][cur[0]][cur[1]][cur[2]]);
        piii p = lp[i][cur[0]][cur[1]][cur[2]];
        cur[0]=p.F;
        cur[1]=p.S.F;
        cur[2]=p.S.S;
    }
    reverse(all(ans));
    for(char x: ans){
        cout<<x<<"\n";
    }
}


signed main()
{
    fast
    #ifdef SWAPNIL07
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    int t=1;
    while(t--){
        solve();
    }
    return 0;
}





Measured memory_bytes: 324316