#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

// template {{{  0 
// using {{{ 1
using ll = long long int;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%lld", &x)
#define Scll2(x,y) scanf("%lld%lld", &x, &y)
#define Scll3(x,y,z) scanf("%lld%lld%lld", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (2e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Repe(x,y,z) for(ll x = z; x < y; x++)
#define Rep(x,y) Repe(x,y,0)
#define RRepe(x,y,z) for(ll x = y-z-1; x >= 0; x--)
#define RRep(x,y) RRepe(x,y,0)
// }}} 2
// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n")
#define YESNO(a) (a)?printf("YES\n"):printf("NO\n")
// }}} 2
// }}} 1
// input {{{ 1
// }}} 1
// }}} 0

int main() {

    int N;
    Scd(N);
    int A,B,C;
    Scd3(A,B,C);

    char s[3];
    vi q(N);
    // 0 AB, 1:BC, 2:AC
    Rep(i,N){
        Scs(s);
        if( s[0] == 'B' ) q[i] = 1;
        else if( s[1] == 'C') q[i] = 2;
        // q[i] = i*i%3;
    }

    bool ok = true;
    vector<char> ans(N);
    Rep(i,N){
        if( q[i] == 0 ){
            if( A+B == 0 ) ok = false;
            else if( A == 0 ){
                ans[i] = 'A';
                A++,B--;
            }else if( B == 0 ){
                ans[i] = 'B';
                B++,A--;
            }else if( q[i+1] == 1 ) {
                ans[i] = 'B';
                B++,A--;
            } else if( q[i+1] == 2 ) {
                ans[i] = 'A';
                B--,A++;
            } else if( A > B ){
                ans[i] = 'B';
                B++,A--;
            } else {
                ans[i] = 'A';
                B--,A++;
            }
        }else if( q[i] == 1 ){
            if( B+C == 0 ) ok = false;
            else if( B == 0 ){
                ans[i] = 'B';
                B++,C--;
            }else if( C == 0 ){
                ans[i] = 'C';
                C++,B--;
            }else if( q[i+1] == 2 ) {
                ans[i] = 'C';
                C++,B--;
            } else if( q[i+1] == 0 ) {
                ans[i] = 'B';
                C--,B++;
            } else if( B > C ){
                ans[i] = 'C';
                C++,B--;
            } else {
                ans[i] = 'B';
                C--,B++;
            }
        }else{
            if( A+C == 0 ) ok = false;
            else if( A == 0 ){
                ans[i] = 'A';
                A++,C--;
            }else if( C == 0 ){
                ans[i] = 'C';
                C++,A--;
            }else if( q[i+1] == 1 ) {
                ans[i] = 'C';
                C++,A--;
            } else if( q[i+1] == 0 ) {
                ans[i] = 'A';
                C--,A++;
            } else if( A > C ){
                ans[i] = 'C';
                C++,A--;
            } else {
                ans[i] = 'A';
                C--,A++;
            }
        }
        // printf ("%d %d %d\n", A, B, C );
        if( !ok ) break;
    }

    YesNo(ok);
    if( ok ){
        Rep(i,N){
            printf ("%c\n", ans[i] );
        }
    }


    return 0;
}



Measured memory_bytes: 3888