#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
const LL mod=1000000007;
const LL LINF=1LL<<62;
const int INF=1<<30;
int dx[]={1,0,-1,0,1,-1,1,-1};
int dy[]={0,1,0,-1,1,-1,-1,1};



int main(){
    LL n,a,b,c;cin >> n >> a >> b >> c;
    vector<string> s(n);
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    int cnt = 0;
    if(a == 0) cnt++;
    if(b == 0) cnt++;
    if(c == 0) cnt++;
    if(cnt == 3){
        puts("No");
    }
    else {
        vector<string> ans(n);
        for (int i = 0; i < n-1; i++) {
            if(s[i] == "AB"){
                if(a < b){
                    ans[i] = "A";
                    a++;
                    b--;
                }
                else if(a > b){
                    ans[i] = "B";
                    b++;
                    a--;
                }
                else{
                    if(a == b && a == 0){
                        puts("No");
                        return 0;
                    }
                    if(s[i+1] == "AB"){
                        ans[i] = "A";
                        a++;
                        b--;
                    }
                    else if(s[i+1] == "BC"){
                        ans[i] = "B";
                        b++;
                        a--;
                    }
                    else{
                        ans[i] = "A";
                        a++;
                        b--;
                    }
                }
            }
            else if(s[i] == "BC"){
                if(b < c){
                    ans[i] = "B";
                    b++;
                    c--;
                }
                else if(b > c){
                    ans[i] = "C";
                    c++;
                    b--;
                }
                else{
                    if(b == c && b == 0){
                        puts("No");
                        return 0;
                    }
                    if(s[i+1] == "AB"){
                        ans[i] = "B";
                        b++;
                        c--;
                    }
                    else if(s[i+1] == "BC"){
                        ans[i] = "B";
                        b++;
                        c--;
                    }
                    else{
                        ans[i] = "C";
                        c++;
                        b--;
                    }
                }
            }
            else{//AC
                if(a < c){
                    ans[i] = "A";
                    a++;
                    c--;
                }
                else if(a > c){
                    ans[i] = "C";
                    c++;
                    a--;
                }
                else{
                    if(a == c && a == 0){
                        puts("No");
                        return 0;
                    }
                    if(s[i+1] == "AB"){
                        ans[i] = "A";
                        a++;
                        c--;
                    }
                    else if(s[i+1] == "BC"){
                        ans[i] = "C";
                        c++;
                        a--;
                    }
                    else{
                        ans[i] = "A";
                        a++;
                        c--;
                    }
                }
            }
        }
        if(s[n-1] == "AB"){
            if(a == 0 && b == 0){
                puts("No");
                return 0;
            }
            else if(a){
                ans[n-1] = "B";
            }
            else{
                ans[n-1] = "A";
            }
        }
        else if(s[n-1] == "BC"){
            if(b == 0 && c == 0){
                puts("No");
                return 0;
            }
            else if(b){
                ans[n-1] = "C";
            }
            else{
                ans[n-1] = "B";
            }
        }
        else{
            if(a == 0 && c == 0){
                puts("No");
                return 0;
            }
            else if(a){
                ans[n-1] = "C";
            }
            else{
                ans[n-1] = "A";
            }
        }
        puts("Yes");
        for (int i = 0; i < n; i++) {
            cout << ans[i] << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 9596