#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
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 int MOD = 1000000007;
const int INF = 1e9;

const int mod = 1000000007;
const int inf = 1e9;
#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    int sum = a+b+c;
    vector<char> ans;
    if(sum == 0) {
        cout << "No" << endl;
        return 0;
    } else {
        vector<string> s(n);
        for(int i = 0; i < n; i++) {
            cin >> s[i];
        }
        for(int i = 0; i < n; i++) {
            if(s[i] == "AB") {
                if(a == 0 && b == 0) {
                    cout << "No" << endl;
                    return 0;
                }else if(a == 0) {
                    a++, b--;
                    ans.push_back('A');
                }else if(b == 0) {
                    a--, b++;
                    ans.push_back('B');
                }else{
                    if(i < n-1 && s[i]!=s[i+1]) {
                        if(s[i+1] == "BC") {
                            a--, b++;
                            ans.push_back('B');
                        }else{
                            a++, b--;
                            ans.push_back('A');
                        }
                    }else{
                        if(a >= b) {
                            a--, b++;
                            ans.push_back('B');
                        }else{
                            a++, b--;
                            ans.push_back('A');
                        }
                    }
                }
            }else if(s[i] == "BC") {
                if(b == 0 && c == 0) {
                    cout << "No" << endl;
                    return 0;
                }else if(b == 0) {
                    b++, c--;
                    ans.push_back('B');
                }else if(c == 0) {
                    b--, c++;
                    ans.push_back('C');
                }else{
                    if(i < n-1 && s[i] != s[i+1]) {
                        if(s[i+1] == "AB") {
                            c--, b++;
                            ans.push_back('B');
                        }else{
                            c++, b--;
                            ans.push_back('C');
                        }
                    }else{
                        if(b >= c) {
                            b--, c++;
                            ans.push_back('C');
                        }else{
                            b++, c--;
                            ans.push_back('B');
                        }
                    }
                }
            }else{
                if(c == 0 && a == 0) {
                    cout << "No" << endl;
                    return 0;
                }else if(c == 0) {
                    c++, a--;
                    ans.push_back('C');
                }else if(a == 0) {
                    c--, a++;
                    ans.push_back('A');
                }else{
                    if(i < n-1 && s[i]!=s[i+1]) {
                        if(s[i+1] == "AB") {
                            c--, a++;
                            ans.push_back('A');
                        }else{
                            c++, a--;
                            ans.push_back('C');
                        }
                    }else{
                        if(c >= a) {
                            c--, a++;
                            ans.push_back('A');
                        }else{
                            c++, a--;
                            ans.push_back('C');
                        }
                    }
                }
            }
        }
        cout << "Yes" << endl;
        for(int i = 0; i < n; i++) {
            cout << ans[i] << endl;
        }
    }
    
}

Measured memory_bytes: 6748