#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb(x) push_back(x)
#define all(x) x.begin(), x.end()
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = 1e9;
const ll INF = 1e18;
const ld EPS = 1e-10;

void print(char x){
    cout << x << endl;
}

int main(){
    ll N, A, B, C;
    cin >> N >> A >> B >> C;
    string s[N];
    rep(i, N) cin >> s[i];
    int cnt = 0;
    if(A == 0) cnt++;
    if(B == 0) cnt++;
    if(C == 0) cnt++;
    if(cnt == 3){
        cout << "No" << endl;
        return 0;
    }
    if(cnt <= 1){
        cout << "Yes" << endl;
        rep(i, N-1){
            if(s[i] == "AB"){
                if(A*B > 0){
                    if(s[i+1] == "AC"){A++,B--;print('A');}
                    else{B++, A--;print('B');}
                }
                else{
                    if(A > 0){A--, B++;print('B');}
                    else{A++, B--;print('A');}
                }
            }elif(s[i] == "BC"){
                if(B*C > 0){
                    if(s[i+1] == "AB"){B++,C--;print('B');}
                    else{C++, B--;print('C');}
                }
                else{
                    if(B > 0){B--, C++;print('C');}
                    else{B++, C--;print('B');}
                }
            }else{
                if(A*C > 0){
                    if(s[i+1] == "AB"){A++,C--;print('A');}
                    else{C++, A--;print('C');}
                }
                else{
                    if(A > 0){A--, C++;print('C');}
                    else{A++, C--;print('A');}
                }
            }
        }
        if(s[N-1] == "AB"){
            if(B > 0) print('A');
            else print('B');
        }elif(s[N-1] == "BC"){
            if(C > 0) print('B');
            else print('C');
        }else{
            if(C > 0) print('A');
            else print('C');
        }
    }else{
        vector<char> ans;
        int j = 0;
        while(cnt == 2 && j < N){
            if(s[j] == "AB"){
                if(A == 0 && B == 0){cout << "No" << endl; return 0;}
                elif(B > 0) {A++, B--; ans.pb('A');}
                else {A--, B++; ans.pb('B');}
            }elif(s[j] == "BC"){
                if(B == 0 && C == 0){cout << "No" << endl; return 0;}
                elif(C > 0) {B++, C--; ans.pb('B');}
                else {B--, C++; ans.pb('C');}
            }else{
                if(A == 0 && C == 0){cout << "No" << endl; return 0;}
                elif(C > 0) {A++, C--; ans.pb('A');}
                else {A--, C++; ans.pb('C');}
            }
            j++;
            cnt = (A==0)+(B==0)+(C==0);
        }
        cout << "Yes" << endl;
        for(auto &e: ans) cout << e << endl;
        if(j == N) return 0; 
        rep2(i, j, N-2){
            if(s[i] == "AB"){
                if(A*B > 0){
                    if(s[i+1] == "AC"){A++,B--;print('A');}
                    else{B++, A--;print('B');}
                }
                else{
                    if(A > 0){A--, B++;print('B');}
                    else{A++, B--;print('A');}
                }
            }elif(s[i] == "BC"){
                if(B*C > 0){
                    if(s[i+1] == "AB"){B++,C--;print('B');}
                    else{C++, B--;print('C');}
                }
                else{
                    if(B > 0){B--, C++;print('C');}
                    else{B++, C--;print('B');}
                }
            }else{
                if(A*C > 0){
                    if(s[i+1] == "AB"){A++,C--;print('A');}
                    else{C++, A--;print('C');}
                }
                else{
                    if(A > 0){A--, C++;print('C');}
                    else{A++, C--;print('A');}
                }
            }
        }
        if(s[N-1] == "AB"){
            if(B > 0) print('A');
            else print('B');
        }elif(s[N-1] == "BC"){
            if(C > 0) print('B');
            else print('C');
        }else{
            if(C > 0) print('A');
            else print('C');
        }
    }
}

Measured memory_bytes: 6828