#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

//#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define equals(a,b) (fabs((a)-(b)) < EPS)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

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; }

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

template <typename T>
void print_array(const T &ary, int size){
    REP(i,size){
        cout << ary[i] << " ";
    }
    cout << endl;
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);
const int MAX_N = 1e5+10;

int dp[MAX_N][10][10] = {};

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(12);

    int N,A,B,C;
    cin >>N>>A>>B>>C;
    vector<string> vs(N);
    REP(i,N){
        cin >> vs[i];
    }
    REP(i,MAX_N) REP(j,8) REP(k,8) dp[i][j][k] = -INF;
    dp[0][2][2] = 1;
    REP(i,N){
        if(vs[i] == "AB"){
            REP(j,6) REP(k,6){
                if(dp[i][j][k] >= 0) {
                    if(k-1 >= 0) dp[i+1][j+1][k-1] = 1;
                    if(j-1 >= 0) dp[i+1][j-1][k+1] = 1;
                    if(k-1 >= 0) if(B+(k-1-2) < 0) dp[i+1][j+1][k-1] = -INF;
                    if(j-1 >= 0) if(A+(j-1-2) < 0) dp[i+1][j-1][k+1] = -INF;
                }
            }
        }else if(vs[i] == "AC"){
            REP(j,6) REP(k,6){
                if(dp[i][j][k] >= 0) {
                    if(4-(j+1+k) >= -2 ) dp[i+1][j+1][k] = 1;
                    if(j-1 >= 0) dp[i+1][j-1][k] = 1;
                    if(4-(j+1+k) >= -2 ) if(C+(4-(j+1+k)) < 0) dp[i+1][j+1][k] = -INF;
                    if(j-1 >= 0) if(A+(j-1-2) < 0) dp[i+1][j-1][k] = -INF;
                }
            }
 

        }else{ // BC
            REP(j,6) REP(k,6){
                if(dp[i][j][k] >= 0) {
                    if((4-(j+k+1) >= -2)) dp[i+1][j][k+1] = 1;
                    if(k-1 >= 0) dp[i+1][j][k-1] = 1;
                    if((4-(j+k+1) >= -2)) if(C+(4-(j+k+1)) < 0) dp[i+1][j][k+1] = -INF;
                    if(k-1 >= 0) if(B+(k-1-2) < 0) dp[i+1][j][k-1] = -INF;
                }
            }
 
        }

    }
    int sj = -10 ,sk = -10;
    REP(j,6) REP(k,6){
        //cout << j-2 << " " << k-2 << " " << dp[N][j][k] << endl;
        if(dp[N][j][k] == 1){
            sj = j;
            sk = k;
        }
    }
    if(sj == -10 && sk == -10){
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;
    string ans;
    for(int i = N; i > 0; i--){

        bool ok = false;
        REP(j,6) {
            if(ok) break;
            REP(k,6) {
                if(dp[i-1][j][k] < 0) continue;

                int dj = sj - j;
                int dk = sk - k;
                int dl = (4-(sj+sk) - (4-(j+k)));
                dump(dj)
                    dump(dk)
                    dump(dl)
                if(vs[i-1] == "AB"){
                        if(dj == 1 && dk == -1) ans += "A";
                        else if(dj == -1 && dk == 1) ans += "B";
                        else {
                            continue;
                        }
                        ok = true;
                        sj = j;
                        sk = k;
                        break;
                }else if(vs[i-1] == "AC"){
                    if(dj == 1 && dl == -1) ans += "A";
                    else if(dj == -1 && dl == 1) ans += "C";
                    else{
                        continue;
                    }
                    ok = true;
                    sj = j;
                    sk = k;
                    break;
                }else{

                    if(dk == 1 && dl == -1) ans += "B";
                    else if(dk == -1 && dl == 1) ans += "C";
                    else{
                        continue;
                    }

                    ok = true;
                    sj = j;
                    sk = k;
                    break;
                }
            }
        }
    }
    reverse(ans.begin(),ans.end());
    for(char x : ans){
        cout << x << endl;
    }


}

Measured memory_bytes: 45764