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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

int main()
{
    cout << fixed << setprecision(15);
    ll N, A, B, C;
    cin >> N >> A >> B >> C;

    vector<string> S(N);
    vector<char> ans(N);

    REP(i, N){
        cin >> S[i];
    }

    // if(A+B+C == 1){
    //     cout << "No" << endl;
    //     return 0;
    // }

    REP(i, N){
        if(S[i] == "AB"){
            if(A == 0 && B == 0){
                cout << "No" << endl;
                return 0;
            }
            else if(A == 0 && B > 0){
                A += 1;
                B -= 1;
                ans[i] = 'A';
            }
            else if(A > 0 && B == 0){
                A -= 1;
                B += 1;
                ans[i] = 'B';
            }
            else if(A == 1 && B == 1){
                if(i+1 <N){
                    if(S[i+1] == "AB"){
                        A += 1;
                        B -= 1;
                        ans[i] = 'A';
                    }
                    else if(S[i+1] == "BC"){
                        A -= 1;
                        B += 1;
                        ans[i] = 'B';
                    }
                    else if(S[i+1] == "AC"){
                        A += 1;
                        B -= 1;
                        ans[i] = 'A';
                    }
                }
                else{
                    A += 1;
                    B -= 1;
                    ans[i] = 'A';
                }
            }
            else{
                if(A > B){
                    A -= 1;
                    B += 1;
                    ans[i] = 'B';
                }
                else{
                    A += 1;
                    B -= 1;
                    ans[i] = 'A';
                }
            }

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

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

        }
    }
    cout << "Yes" << endl;
    REP(i, N){
        cout << ans[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 6404