#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }



int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int A, B, C, N;
    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;
    }
    if (A == 0 && C == 0 && S[0] == "AC") {
        cout << "No" << endl;
        return 0;
    }

    if (C == 0 && B == 0 && S[0] == "BC") {
        cout << "No" << endl;
        return 0;
    }
    vector<string> ans(N);
    rep(i, N) {
        if (A == 0 && B == 0 && S[i] == "AB") {
            cout << "No" << endl;
            return 0;
        }
        if (A == 0 && C == 0 && S[i] == "AC") {
            cout << "No" << endl;
            return 0;
        }

        if (C == 0 && B == 0 && S[i] == "BC") {
            cout << "No" << endl;
            return 0;
        }

        if (S[i] == "AB") {
            if (A < B) {
                A++; B--;
                ans[i] = "A";
            }
            else if(A > B) {
                A--; B++;
                ans[i] = "B";
            }
            else {
                if (i + 1 < N && S[i + 1] == "BC" && C == 0) {
                    A--; B++;
                    ans[i] = "B";
                }
                else {
                    A++; B--;
                    ans[i] = "A";
                }
            }
        }
        else if (S[i] == "AC") {
            if (A < C) {
                A++; C--;
                ans[i] = "A";
            }
            else if (A > C) {
                A--; C++;
                ans[i] = "C";
            }
            else {
                if (i + 1 < N && S[i + 1] == "AB" && B == 0) {
                    A++; C--;
                    ans[i] = "A";
                }
                else {
                    A--; C++;
                    ans[i] = "C";
                }
            }
        }
        else {
            if (B < C) {
                B++; C--;
                ans[i] = "B";
            }
            else if(B > C) {
                B--; C++;
                ans[i] = "C";
            }
            else {
                if (i + 1 < N && S[i + 1] == "AC" && A == 0) {
                    B--; C++;
                    ans[i] = "C";
                }
                else {
                    B++; C--;
                    ans[i] = "B";
                }
            }
        }
    }
    cout << "Yes" << endl;
    rep(i, N)
        cout << ans[i] << endl;
    return 0;
}

Measured memory_bytes: 9532