#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;
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; }
const string YES = "Yes";
const string NO = "No";

void solve(long long N, long long A, long long B, long long C, vector<string> s){
    if(A+B+C<=0){
        cout<<"No"<<endl; return;
    }
    vll R{A, B, C};
    if(R[s[0][0]-'A']==0 && R[s[0][1]-'A']==0){
        cout<<"No"<<endl; return;
    }
    //cout<<"Yes"<<endl; 
    string ans;
    if(A+B+C==1){
        REP(i, N){
            if(R[s[i][0]-'A']==0) {
                ans.push_back(s[i][0]);
                R[s[i][0]-'A']++;
                R[s[i][1]-'A']--;
            }
            else if(R[s[i][1]-'A']==0) {
                ans.push_back(s[i][1]);
                R[s[i][1]-'A']++;
                R[s[i][0]-'A']--;
            }
            if(R[0]<0 || R[1]<0||R[2]<0){
                cout<<"No"<<endl; return;
            }
        }
        cout<<"Yes"<<endl; 
        for(auto x: ans) cout<<x<<endl;
    }
    else{
        cout<<"Yes"<<endl; 
        REP(i, N){
            if(R[s[i][0]-'A']==0) {
                cout<<s[i][0]<<endl;
                R[s[i][0]-'A']++;
                R[s[i][1]-'A']--;
            }
            else if(R[s[i][1]-'A']==0) {
                cout<<s[i][1]<<endl;
                R[s[i][1]-'A']++;
                R[s[i][0]-'A']--;
            }
            else if(A+B+C==2 && i < N-1) { //* no zero
                if(s[i][0] == s[i+1][0] || s[i][0] == s[i+1][1]){
                    cout<<s[i][0]<<endl;
                    R[s[i][0]-'A']++;
                    R[s[i][1]-'A']--;
                }
                else if(s[i][1] == s[i+1][0] || s[i][1] == s[i+1][1]){
                    cout<<s[i][1]<<endl;
                    R[s[i][1]-'A']++;
                    R[s[i][0]-'A']--;
                }
            }
            else{ //* A+B+C>2 and no zero
                if(R[s[i][0]-'A'] < R[s[i][1]-'A']){
                    cout<<s[i][0]<<endl;
                    R[s[i][0]-'A']++;
                    R[s[i][1]-'A']--;
                }else{
                    cout<<s[i][1]<<endl;
                    R[s[i][1]-'A']++;
                    R[s[i][0]-'A']--;
                }
            }
        }
    }
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    std::vector<std::string> s(N);
    for(int i = 0 ; i < N ; i++){
        std::cin >> s[i];
    }
    solve(N, A, B, C, std::move(s));
    return 0;
}


Measured memory_bytes: 5548