#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
#define getbit(n, i) (((n) & (1LL << (i))) != 0) 
#define setbit0(n, i) ((n) & (~(1LL << (i)))) 
#define setbit1(n, i) ((n) | (1LL << (i))) 
#define togglebit(n, i) ((n) ^ (1LL << (i))) 
#define lastone(n) ((n) & (-(n))) 
char gap = 32;
template<typename T> 
ostream& operator<<(ostream &os, const vector<T> &v) { 
    os << '{'; 
    for (const auto &x : v) os << gap << x;
        return os << '}'; 
}
template<typename A, typename B> 
ostream& operator<<(ostream &os, const pair<A, B> &p) {
        return os << '(' << p.first << gap << p.second << ')';
}

template <class T>
void read(T &x) {
    char c;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        ;
    for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
}
#define ll long long 
#define lll __int128_t
#define pb push_back
#define mp make_pair
typedef pair < int,int> ii;
typedef vector<ii> vii;
typedef vector<ll>vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll hashPrime = 1610612741;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll n, i, j, k, l, m, a, b, c;
    cin >> n >> a >> b >> c;
    vector<string> data;
    for (i = 1; i <= n;i++){
        string s;
        cin >> s;
        data.pb(s);
    }
    vector<char> res;
    for (i = 0; i < n;i++){
       if(data[i]=="AB"){
           if(a+b==0){
               cout << "No\n";
               return 0;
           }
           if(a!=b){
               if(a<b){
                   a++;
                   b--;
                   res.pb('A');
               }
               else{
                   a--;
                   b++;
                   res.pb('B');
               }
           }
           else{
               if(a==1){
                   if(i+1>=n||data[i]==data[i+1]){
                       res.pb('B');
                       a--;
                       b++;
                   }
                   else{
                       if(data[i+1]=="AC"){
                           a++;
                           b--;
                           res.pb('A');
                       }
                       else{
                           a--;
                           b++;
                           res.pb('B');
                       }
                   } 
               }
               else{
                   a--;
                   b++;
                   res.pb('B');
               }
           }
       }
       if(data[i]=="BC"){
           if(c+b==0){
               cout << "No\n";
               return 0;
           }
           if(c!=b){
               if(c<b){
                   c++;
                   b--;
                   res.pb('C');
               }
               else{
                   c--;
                   b++;
                   res.pb('B');
               }
           }
           else{
               if(c==1){
                   if(i+1>=n||data[i]==data[i+1]){
                       res.pb('B');
                       c--;
                       b++;
                   }
                   else{
                       if(data[i+1]=="AC"){
                           c++;
                           b--;
                           res.pb('C');
                       }
                       else{
                           c--;
                           b++;
                           res.pb('B');
                       }
                   } 
               }
               else{
                   c--;
                   b++;
                   res.pb('B');
               }
           }
       }
       if(data[i]=="AC"){
           if(a+c==0){
               cout << "No\n";
               return 0;
           }
           if(a!=c){
               if(a<c){
                   a++;
                   c--;
                   res.pb('A');
               }
               else{
                   a--;
                   c++;
                   res.pb('C');
               }
           }
           else{
               if(a==1){
                   if(i+1>=n||data[i]==data[i+1]){
                       res.pb('C');
                       a--;
                       c++;
                   }
                   else{
                       if(data[i+1]=="AB"){
                           a++;
                           c--;
                           res.pb('A');
                       }
                       else{
                           a--;
                           c++;
                           res.pb('C');
                       }
                   } 
               }
               else{
                   a--;
                   c++;
                   res.pb('C');
               }
           }
       }
    }
    cout << "Yes\n";
    for(auto x:res)
        cout << x << "\n";
    return 0;
}

Measured memory_bytes: 7472