#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>

#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
//cout << fixed << setprecision(10) << ans << endl;
//int gcd(int a,int b){return b?gcd(b,a%b):a;}

vector<string> moji;
string s[200000];
vector<char> ans;
signed main(){
    int n,a,b,c;
    cin >> n >> a >> b >> c;
    REP(i,n){
        cin >> s[i];
        if(i==0){
            moji.pb(s[i]);
        }
        else{
            if(moji[moji.size()-1]!=s[i]){
                moji.pb(s[i]);
            }
        }
    }
    moji.pb("owari");
    int index = 0;
    REP(i,n){
        if(moji[index] != s[i]) index ++;
        if(s[i]=="AB"){
            if(a == 0 && b == 0){
                cout << "No" << endl;
                return 0;
            } 
            if(a == 0){
                a ++;
                b --;
                ans.pb('A');
                continue;
            }
            if(b == 0){
                b ++;
                a --;
                ans.pb('B');
                continue;
            }
            if(moji[index+1] == "BC"){
                b ++;
                a --;
                ans.pb('B');
                continue;
            }
            else{
                a ++;
                b --;
                ans.pb('A');
                continue;
            }
        }
        if(s[i]=="AC"){
            if(a == 0 && c == 0){
                cout << "No" << endl;
                return 0;
            } 
            if(a == 0){
                a ++;
                c --;
                ans.pb('A');
                continue;
            }
            if(c == 0){
                c ++;
                a --;
                ans.pb('C');
                continue;
            }
            if(moji[index+1] == "AB"){
                a ++;
                c --;
                ans.pb('A');
                continue;
            }
            else{
                c ++;
                a --;
                ans.pb('C');
                continue;
            }


            
        }
        if(s[i]=="BC"){
            if(b == 0 && c == 0){
                cout << "No" << endl;
                return 0;
            } 
            if(b == 0){
                b ++;
                c --;
                ans.pb('B');
                continue;
            }
            if(c == 0){
                c ++;
                b --;
                ans.pb('C');
                continue;
            }
            if(moji[index+1] == "AB"){
                b ++;
                c --;
                ans.pb('B');
                continue;
            }
            else{
                c ++;
                b --;
                ans.pb('C');
                continue;
            }


            
        }
    }
    cout << "Yes" << endl;
    REP(i,n){
        cout << ans[i] << endl;
    }


    return 0;
}

Measured memory_bytes: 13716