#include <bits/stdc++.h>
#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
    #include <filesystem>
    namespace fs = std::filesystem;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;
using ll = long long int;

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }

int N;
ll A,B,C;
vector<string> S;
void input(){
    fast_io();
    #ifdef __LOCAL
        fs::path __p = __FILE__;
        fs::path __input, __output;
        __input = __output = __p.parent_path();
        __input += string("/input/") + string(__p.stem()) + string(".txt");
        __output += string("/output/") + string(__p.stem()) + string(".txt");
        freopen(__input.c_str(), "r", stdin);
        freopen(__output.c_str(), "w", stdout);
    #endif
    cin >> N >> A >> B >> C;
    for (int i = 0; i < N; i++)
    {
        string s; cin >> s;
        S.push_back(s);
    }    
}

void back(int i,vector<char> &ans){
    char l = ans.back();
    string last;
    last+=l;
    ans.pop_back();
    if(S[i-1]=="BC" && last=="C"){
        ans.push_back('B');
        B++,C--;
        B++,C--;
    }
    if(S[i-1]=="BC" && last=="B"){
        ans.push_back('C');
        B--,C++;
        B--,C++;
    }
    if(S[i-1]=="AB" && last=="B"){
        ans.push_back('A');
        B--,A++;
        B--,A++;
    }
    if(S[i-1]=="AB" && last=="A"){
        ans.push_back('B');
        B++,A--;
        B++,A--;
    }
    if(S[i-1]=="AC" && last=="A"){
        ans.push_back('C');
        C++,A--;
        C++,A--;
    }
    if(S[i-1]=="AC" && last=="C"){
        ans.push_back('A');
        C--,A++;
        C--,A++;
    }
}

bool isok(){
    if(A==0 && B==0 && C==0) return false;
    else if(A==0 && B==0 && S[0]=="AB") return false;
    else if(C==0 && B==0 && S[0]=="BC") return false;
    else if(A==0 && C==0 && S[0]=="AC") return false;
    return true;
}

#define NO() do{cout << "No" << "\n"; return 0;}while(false);

int solve(){
    if(!isok()) NO()
    vector<char> ans;
    // 以下すべてYES?
    for (int i = 0; i < N; i++)
    {
        if(S[i]=="AB"){
            if(A+B==0){
                if(A+B+C==1) NO()
                back(i,ans);
            }
            if(B>A){ans.push_back('A');A++,B--;}
            else{   ans.push_back('B');A--,B++;}
        }
        if(S[i]=="BC"){
            if(C+B==0){
                if(A+B+C==1) NO()
                back(i,ans);
            }
            if(C>B){ans.push_back('B');B++,C--;}
            else{   ans.push_back('C');B--,C++;}
        }
        if(S[i]=="AC"){
            if(C+A==0){
                if(A+B+C==1) NO()
                back(i,ans);
            }
            if(C>A){ans.push_back('A');A++,C--;}
            else{   ans.push_back('C');A--,C++;}
        }
    }
    
    cout << "Yes" << "\n";
    for(auto a:ans) cout << a << "\n";
    return 0;
}   

// ただ処理を書くだけ。
int main()
{
    input();
    solve();
    return 0;
}


Measured memory_bytes: 7400