#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll one = 1;
const ll INF = 9223372036854775807; //10^18
const int inINF = 2147483647; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    ll N, A, B, C;
    cin >> N >> A >> B >> C;
    vector<char> ans(N);
    vector<string> q(N);
    for (ll i = 0; i < N; i++) {
        cin >> q[i];
    }

    for (int i = 0; i < N-1; i++) {
        if(q[i] == "AB"){
            if(A == 1 && B == 1){
                if(q[i+1] == "AB"){
                    ans[i] = 'A'; A++; B--;
                }
                else if(q[i+1] == "AC"){
                    ans[i] = 'A'; A++; B--;
                }
                else if(q[i+1] == "BC"){
                    ans[i] = 'B'; B++; A--;
                }
            }
            else if(A > B){
                ans[i] = 'B'; B++; A--;
            }
            else{
                ans[i] = 'A'; A++; B--;
                if(B < 0){
                    No(); return 0;
                }
            }
        }
        else if(q[i] == "AC"){
            if(A == 1 && C == 1){
                if(q[i+1] == "AB"){
                    ans[i] = 'A'; A++; C--;
                }
                else if(q[i+1] == "AC"){
                    ans[i] = 'A'; A++; C--;
                }
                else if(q[i+1] == "BC"){
                    ans[i] = 'C'; C++; A--;
                }
            }
            else if(A > C){
                ans[i] = 'C'; C++; A--;
            }
            else{
                ans[i] = 'A'; A++; C--;
                if(C < 0){
                    No(); return 0;
                }
            }
        }
        else if(q[i] == "BC"){
            if(B == 1 && C == 1){
                if(q[i+1] == "AB"){
                    ans[i] = 'B'; B++; C--;
                }
                else if(q[i+1] == "AC"){
                    ans[i] = 'C'; C++; B--;
                }
                else if(q[i+1] == "BC"){
                    ans[i] = 'C'; C++; B--;
                }
            }
            else if(B > C){
                ans[i] = 'C'; C++; B--;
            }
            else{
                ans[i] = 'B'; B++; C--;
                if(C < 0){
                    No(); return 0;
                }
            }            
        }
    }
    if(q[N-1] == "AB"){
        if(A > B){
            ans[N-1] = 'B'; B++; A--;
        }
        else{
            ans[N-1] = 'A'; A++; B--;
            if(B < 0){
                No(); return 0;
            }
        }
    }
    else if(q[N-1] == "AC"){
        if(A > C){
            ans[N-1] = 'C'; C++; A--;
        }
        else{
            ans[N-1] = 'A'; A++; C--;
            if(C < 0){
                No(); return 0;
            }
        }
    }
    else{
        if(C > B){
            ans[N-1] = 'B'; B++; C--;
        }
        else{
            ans[N-1] = 'C'; C++; B--;
            if(B < 0){
                No(); return 0;
            }
        }
    }

    Yes();
    for (ll i = 0; i < N; i++) {
        printf("%c\n", ans[i]);
    }

}

Measured memory_bytes: 6440