#include <bits/stdc++.h>
using namespace std;

typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;
typedef vector< vector< vector<ll> > > vvvint;
typedef vector<string> vstring;
typedef vector< vector<string> > vvstring;
typedef vector<char> vchar;
typedef vector< vector<char> > vvchar;
typedef vector<long double> vdouble;
typedef vector< vector<long double> > vvdouble;
typedef vector< vector< vector<long double> > > vvvdouble;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;
typedef vector<bool> vbool;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ALL(obj) (obj).begin(), (obj).end()
// #define LLONG_MAX 9223372036854775806
#define MOD 1000000007
const double PI=3.14159265358979323846;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<typename T> T Ceil(T a, T b){return (a+b-1)/b;}

int dy[]={0, 0, 1, -1, 1, -1, -1, 1};
int dx[]={1, -1, 0, 0, 1, 1, -1, -1};

void printv(vint &v){
    for(auto e:v) cout<<e<<" ";
        cout<<endl;
    }

int main() {
    cout<<fixed<<setprecision(10);

    ll n,a,b,c; cin>>n>>a>>b>>c;
    map<string,ll> m;

    vstring s(n);
    rep(i,n) cin>>s[i];
    s.push_back("AB");

    vstring ans;

    rep(i,n){
        if(s[i] == "AB"){
            if(a == 0 && b == 0){
                puts("No");
                return 0;
            }

            if(a < b){
                ans.push_back("A");
                a++; b--;
            }else if(b < a){
                ans.push_back("B");
                b++; a--;
            }else{
                if(s[i+1] == "AB" || s[i+1] == "AC"){
                    ans.push_back("A");
                    a++;
                    b--;
                }else{
                    ans.push_back("B");
                    b++;
                    a--;
                }
            }

        }else if(s[i] == "AC"){
            if(a == 0 && c == 0){
                puts("No");
                return 0;
            }

            if(a < c){
                ans.push_back("A");
                a++; c--;
            }else if(c < a){
                ans.push_back("C");
                c++; a--;
            }else{
                if(s[i+1] == "AB" || s[i+1] == "AC"){
                    ans.push_back("A");
                    a++;
                    c--;
                }else{
                    ans.push_back("C");
                    c++;
                    a--;
                }
            }

        }else{ // "BC"
            if(b == 0 && c == 0){
                puts("No");
                return 0;
            }

            if(b < c){
                ans.push_back("B");
                b++; c--;
            }else if(c < b){
                ans.push_back("C");
                c++; b--;
            }else{
                if(s[i+1] == "AB" || s[i+1] == "BC"){
                    ans.push_back("B");
                    b++;
                    c--;
                }else{
                    ans.push_back("C");
                    c++;
                    b--;
                }
            }
        }
    }

    puts("Yes");
    for(auto e:ans) cout<<e<<endl;


    return 0;

}

Measured memory_bytes: 13624