#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
#define ll long long
#define umap unordered_map
using graph = vector<vector<int>>;
using graph2 = vector<vector<pair<int, int>>>;

ll mod(ll x, ll y){if(x>=0||x%y==0) return x%y;return y+x%y;} //mod including minus
ll dv0(ll x, ll y){if(x>=0||x%y==0)return x/y;return x/y-1;} //rnd down
ll dv1(ll x, ll y){if(x%y==0) return dv0(x,y);return dv0(x,y)+1;} //rnd up
ll M=1e9+7;
int quick_pow(int x,int p){
    int a=1,po=x;
    while(p){
        if(p&1)  a=1ll*a*po%M;
        po=1ll*po*po%M;p>>=1;
    }
    return a;
}

/*解法1
int N;
bool dfs(vector<string> &S, int A, int B, int C, int i, string &ans){
    if(i==N){
        if(A>=0&&B>=0&&C>=0){
            return true;
        }else{
            return false;
        }
    }else if(!(A>=0&&B>=0&&C>=0)){
        return false;
    }else{
        if(S.at(i)=="AB"){
            if(A>B){
                ans.at(i)='B';
                return dfs(S, A-1, B+1, C, i+1, ans);
            }
            if(B>A){
                ans.at(i)='A';
                return dfs(S, A+1, B-1, C, i+1, ans);
            }
            if(dfs(S, A+1, B-1, C, i+1, ans)){
                ans.at(i)='A';
                return true;
            }else if(dfs(S, A-1, B+1, C, i+1, ans)){
                ans.at(i)='B';
                return true;
            }else{
                return false;
            }
        }else if(S.at(i)=="BC"){
            if(B>C){
                ans.at(i)='C';
                return dfs(S, A, B-1, C+1, i+1, ans);
            }
            if(C>B){
                ans.at(i)='B';
                return dfs(S, A, B+1, C-1, i+1, ans);
            }
            if(dfs(S, A, B+1, C-1, i+1, ans)){
                ans.at(i)='B';
                return true;
            }else if(dfs(S, A, B-1, C+1, i+1, ans)){
                ans.at(i)='C';
                return true;
            }else{
                return false;
            }
        }else{
            if(C>A){
                ans.at(i)='A';
                return dfs(S, A+1, B, C-1, i+1, ans);
            }
            if(A>C){
                ans.at(i)='C';
                return dfs(S, A-1, B, C+1, i+1, ans);
            }
            if(dfs(S, A-1, B, C+1, i+1, ans)){
                ans.at(i)='C';
                return true;
            }else if(dfs(S, A+1, B, C-1, i+1, ans)){
                ans.at(i)='A';
                return true;
            }else{
                return false;
            }
        }
    }
}
//Start from Here
int main(){
    int A, B, C;
    cin>>N>>A>>B>>C;
    vector<string> S;
    string c;
    rep(i, N){
        cin>>c;
        S.push_back(c);
    }
    string ans;
    rep(i, N){
        ans+="A";
    }
    if(dfs(S, A, B, C, 0, ans)){
        cout<<"Yes"<<endl;
        rep(i, N){
            cout<<ans.at(i)<<endl;
        }
    }else{
        cout<<"No"<<endl;
    }
    
}
*/
int main(){
    ll N, A, B, C;
    cin>>N>>A>>B>>C;
    vector<string> S;
    string c;
    rep(i, N){
        cin>>c;
        S.push_back(c);
    }
    string ans;
    if(A+B+C>=3){
        if(S.at(0)=="AB"){
            if(A==0&&B==0){
                cout<<"No"<<endl;
                return 0;
            }
        }
        if(S.at(0)=="BC"){
            if(B==0&&C==0){
                cout<<"No"<<endl;
                return 0;
            }
        }
        if(S.at(0)=="AC"){
            if(A==0&&C==0){
                cout<<"No"<<endl;
                return 0;
            }
        }
        cout<<"Yes"<<endl;
        rep(i, N){
            if(S.at(i)=="AB"){
                if(A>B){
                    B++;A--;
                    ans+="B";
                }else{
                    A++;B--;
                    ans+="A";
                }
            }else if(S.at(i)=="BC"){
                if(B>C){
                    C++;B--;
                    ans+="C";
                }else{
                    B++;C--;
                    ans+="B";
                }
            }else{
                if(C>A){
                    A++;C--;
                    ans+="A";
                }else{
                    C++;A--;
                    ans+="C";
                }
            }
        }
    }else if(A+B+C==0){
        cout<<"No"<<endl;
        return 0;
    }else if(A+B+C==2){
        if(S.at(0)=="AB"){
            if(A==0&&B==0){
                cout<<"No"<<endl;
                return 0;
            }
        }
        if(S.at(0)=="BC"){
            if(B==0&&C==0){
                cout<<"No"<<endl;
                return 0;
            }
        }
        if(S.at(0)=="AC"){
            if(A==0&&C==0){
                cout<<"No"<<endl;
                return 0;
            }
        }
        cout<<"Yes"<<endl;
        rep(i, N){
            if(S.at(i)=="AB"){
                if(A>B){
                    B++;A--;
                    ans+="B";
                }else if(B>A){
                    A++;B--;
                    ans+="A";
                }else{
                    if(i==N-1){
                        A++;B--;
                        ans+="A";
                    }else{
                        if(S.at(i+1)=="BC"){
                            A--;C++;
                            ans+="BC";
                            i++;
                        }else if(S.at(i+1)=="AC"){
                            B--;C++;
                            ans+="AC";
                            i++;
                        }else{//iranai
                            ans+="AB";
                            i++;
                        }
                    }
                }
            }else if(S.at(i)=="BC"){
                if(B>C){
                    C++;B--;
                    ans+="C";
                }else if(C>B){
                    B++;C--;
                    ans+="B";
                }else{
                    if(i==N-1){
                        B++;C--;
                        ans+="B";
                    }else{
                        if(S.at(i+1)=="AC"){
                            B--;A++;
                            ans+="CA";
                            i++;
                        }else if(S.at(i+1)=="AB"){
                            C--;A++;
                            ans+="BA";
                            i++;
                        }else{//iranai
                            ans+="BC";
                            i++;
                        }
                    }
                }
            }else{
                if(C>A){
                    A++;C--;
                    ans+="A";
                }else if(A>C){
                    C++;A--;
                    ans+="C";
                }else{
                    if(i==N-1){
                        C++;A--;
                        ans+="C";
                    }else{
                        if(S.at(i+1)=="AB"){
                            C--;B++;
                            ans+="AB";
                            i++;
                        }else if(S.at(i+1)=="BC"){
                            A--;B++;
                            ans+="CB";
                            i++;
                        }else{//iranai
                            ans+="AC";
                            i++;
                        }
                    }
                }
            }
        }
    }else{
        rep(i, N){
            if(S.at(i)=="AB"){
                if(A>B){
                    B++;A--;
                    ans+="B";
                }else if(B>A){
                    A++;B--;
                    ans+="A";
                }else{
                    cout<<"No"<<endl;
                    return 0;
                }
            }else if(S.at(i)=="BC"){
                if(B>C){
                    C++;B--;
                    ans+="C";
                }else if(C>B){
                    B++;C--;
                    ans+="B";
                }else{
                    cout<<"No"<<endl;
                    return 0;
                }
            }else{
                if(C>A){
                    A++;C--;
                    ans+="A";
                }else if(A>C){
                    C++;A--;
                    ans+="C";
                }else{
                    cout<<"No"<<endl;
                    return 0;
                }
            }
        }
        cout<<"Yes"<<endl;
    }
    rep(i, N){
        cout<<ans.at(i)<<endl;
    }
}

Measured memory_bytes: 7468