#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>

using namespace std;

#define ll long long
#define ld long double
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

const double PI=acos(-1);
const double EPS=1e-9; //うまくいかなかったらゆるめる

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
typedef vector<pii> vp;
typedef vector<vi> vvi;

int gcd(int a, int b){if(b==0) return a;return gcd(b,a%b);}
int lcm(int a, int b){return a/gcd(a,b)*b;}


signed main(void) {
    int n,a,b,c;
    cin >> n >> a >> b >> c;
    vs s(n);
    vector<vp> v(3);
    rep(i,n){
        cin >> s[i];
        if(s[i] == "AB"){
            v[0].push_back(pii(i,1));
            v[1].push_back(pii(i,0));
        }
        if(s[i] == "AC"){
            v[0].push_back(pii(i,2));
            v[2].push_back(pii(i,0));
        }
        if(s[i] == "BC"){
            v[1].push_back(pii(i,2));
            v[2].push_back(pii(i,1));
        }
    }
    string ans;
    rep(i,n){
        //cout << a << " " << b <<" "  << c << endl;
        if(s[i] == "AB"){
            if(a == 0 && b == 0){
                cout << "No" << endl;
                return 0;
            }
            if(a < b)a++,b--,ans+='A';
            else if(a > b) a--,b++,ans+='B';
            else{
                int na = upper_bound(all(v[0]),pii(i,1)) - v[0].begin();
                int nb = upper_bound(all(v[1]),pii(i,0)) - v[1].begin();
                if(na == v[0].size())a--,b++,ans+='B';
                else if(nb == v[1].size())a++,b--,ans+='A';
                else if(v[0][na].first < v[1][nb].first)a++,b--,ans+='A';
                else a--,b++,ans+='B';
            }
        }
        if(s[i] == "AC"){
            if(a == 0 && c == 0){
                cout << "No" << endl;
                return 0;
            }
            if(a < c)a++,c--,ans+='A';
            else if(a > c)a--,c++,ans+='C';
            else{
                int na = upper_bound(all(v[0]),pii(i,2)) - v[0].begin();
                int nc = upper_bound(all(v[2]),pii(i,0)) - v[2].begin();
                if(na == v[0].size())a--,c++,ans+='C';
                else if(nc == v[2].size())a++,c--,ans+='A';
                else if(v[0][na].first < v[2][nc].first)a++,c--,ans+='A';
                else a--,c++,ans+='C';
            }
        }
        if(s[i] == "BC"){
            if(b == 0 && c == 0){
                cout << "No" << endl;
                return 0;
            }
            if(b < c)b++,c--,ans+='B';
            else if(b > c)b--,c++,ans+='C';
            else{
                int nb = upper_bound(all(v[1]),pii(i,2)) - v[1].begin();
                int nc = upper_bound(all(v[2]),pii(i,1)) - v[2].begin();
                if(nb == v[1].size())b--,c++,ans+='C';
                else if(nc == v[2].size())b++,c--,ans+='B';
                else if(v[1][nb].first < v[2][nc].first)b++,c--,ans+='B';
                else b--,c++,ans+='C';
            }
        }
    }
    cout << "Yes" << endl;
    rep(i,n)cout << ans[i] << endl;
}


Measured memory_bytes: 9612