#include <cstdio> 
#include <cstdlib> 
#include <cmath> 
#include <cstring> 
#include <climits> 
#include <cfloat> 
#include <map> 
#include <utility> 
#include <set> 
#include <iostream> 
#include <memory> 
#include <string> 
#include <vector> 
#include <algorithm> 
#include <functional> 
#include <sstream> 
#include <complex> 
#include <stack> 
#include <queue> 
#include <numeric>
#include <cassert>

#define FOR(i, min, max) for (int i = (min); i < (max); ++i) 
#define FORE(i, min, max) for (int i = (min); i <= (max); ++i) 
#define REP(i, n) for (int i = 0; i < (n); ++i) 
#define REPV(vec, i) for (int i = 0; i < (int)(vec.size()); ++i) 
#define FOR_EACH(vec, it) for (typeof((vec).begin()) it = (vec).begin(); it != (vec).end(); ++it)

using namespace std; 
static const double EPS = 1e-12; 
typedef long long ll; 

bool visited[100200][4][4][4];

int N;

bool solve(const vector<string> &s, int i, int A, int B, int C, string &ans) {
    if (A < 0 || B < 0 || C < 0) return false;
    if (i == N) return true;
    if (visited[i][A][B][C])
        return false;
    visited[i][A][B][C] = true;
    if (s[i] == "AB") {
        if (A == 0 && B == 0) return false;
        if (solve(s, i+1, A+1, B-1, C, ans)) {
            ans += 'A';
            return true;
        }
        if (solve(s, i+1, A-1, B+1, C, ans)) {
            ans += 'B';
            return true;
        }
    }
    else if (s[i] == "AC") {
        if (A == 0 && C == 0) return false;
        if (solve(s, i+1, A+1, B, C-1, ans)) {
            ans += 'A';
            return true;
        }
        if (solve(s, i+1, A-1, B, C+1, ans)) {
            ans += 'C';
            return true;
        }
    }
    else { assert(s[i] == "BC");
        if (B == 0 && C == 0) return false;
        if (solve(s, i+1, A, B+1, C-1, ans)) {
            ans += 'B';
            return true;
        }
        if (solve(s, i+1, A, B-1, C+1, ans)) {
            ans += 'C';
            return true;
        }
    }
    return false;
}

int main(void)
{
    int A, B, C;
    cin >> N >> A >> B >> C;
    vector<string> s(N);
    REP(i, N) cin >> s[i];
    
    if (A == 0 && B == 0 && s[0] == "AB") {
        cout << "No" << endl; return 0;
    }
    else if (A == 0 && C == 0 && s[0] == "AC") {
        cout << "No" << endl; return 0;
    }
    else if (B == 0 && C == 0 && s[0] == "BC") {
        cout << "No" << endl; return 0;
    }
    
    if (A + B + C >= 3) {
        cout << "Yes" << endl;
        REP(i, N) {
            if (s[i] == "AB") {
                if (A > B) {
                    cout << "B" << endl; B++; A--; assert(A >= 0);
                }
                else {
                    cout << "A" << endl; A++; B--; assert(B >= 0);
                }
            }
            else if (s[i] == "AC") {
                if (A > C) {
                    cout << "C" << endl; C++; A--; assert(A >= 0);
                }
                else {
                    cout << "A" << endl; A++; C--; assert(C >= 0);
                }
            }
            else { assert(s[i] == "BC");
                if (B > C) {
                    cout << "C" << endl; C++; B--; assert(B >= 0);
                }
                else {
                    cout << "B" << endl; B++; C--; assert(C >= 0);
                }
            }
        }
    }
    else {
        memset(visited, 0, sizeof(visited));
        string ans;
        solve(s, 0, A, B, C, ans);
        if (ans.empty()) {
            cout << "No" << endl;
        }
        else {
            cout << "Yes" << endl;
            assert(ans.size() == N);
            REP(i, N)
                cout << ans[N-i-1] << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 20680