#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
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; }

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

template<class T> inline T sqr(T x) {return x*x;}

bool dfs(LL n, LL a, LL b, LL c, vector<char> &cs, const VS &s, map<tuple<int,int,int,int>, bool> &memo, int idx) {
    if (a < 0 || b < 0 || c < 0) return false;
    if (idx == n) return true;
    auto t = make_tuple(idx,a,b,c);
    if (memo.count(t) > 0) return memo[t];
    if (s[idx] == "AB") {
        {
            cs.push_back('A');
            ++a; --b;
            if (dfs(n,a,b,c,cs,s,memo,idx+1)) return memo[t] = true;
            --a; ++b;
            cs.pop_back();
        }
        {
            cs.push_back('B');
            --a; ++b;
            if (dfs(n,a,b,c,cs,s,memo,idx+1)) return memo[t] = true;
            ++a; --b;
            cs.pop_back();
        }
    }
    if (s[idx] == "AC") {
        {
            cs.push_back('A');
            ++a; --c;
            if (dfs(n,a,b,c,cs,s,memo,idx+1)) return memo[t] = true;
            --a; ++c;
            cs.pop_back();
        }
        {
            cs.push_back('C');
            --a; ++c;
            if (dfs(n,a,b,c,cs,s,memo,idx+1)) return memo[t] = true;
            ++a; --c;
            cs.pop_back();
        }
    }
    if (s[idx] == "BC") {
        {
            cs.push_back('B');
            ++b; --c;
            if (dfs(n,a,b,c,cs,s,memo,idx+1)) return memo[t] = true;
            --b; ++c;
            cs.pop_back();
        }
        {
            cs.push_back('C');
            --b; ++c;
            if (dfs(n,a,b,c,cs,s,memo,idx+1)) return memo[t] = true;
            ++b; --c;
            cs.pop_back();
        }
    }
    return memo[t] = false;
}

void solve() {
    LL n,a,b,c;
    cin >> n >> a >> b >> c;
    VS s(n);
    REP(i,0,n) cin >> s[i];
    VI cnt(3);
    REP(i,0,n) REP(j,0,2) cnt[s[i][j] - 'A']++;
    map<tuple<int,int,int,int>, bool> memo;
    vector<char> cs;
    dfs(n,a,b,c,cs,s,memo,0);
    if (cs.size() == n) {
        cout << "Yes" << endl;
        for (char c: cs) cout << c << endl;
    } else {
        cout << "No" << endl;
    }
}

signed main() {
    solve();
    
    return 0;
}

Measured memory_bytes: 32056