#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <cstring>
#include <queue>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cstdlib>
#include <sstream>
#include <bitset>

using namespace std;

//#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

typedef long long ll;
typedef vector<ll> Vec;
typedef pair<ll, ll> Pair;
#define rep(i, n) for(ll i=0;i<n;i++)

//static const ll MOD = 1000000007;
//static const ll INF = 100000000;
//#define PI 3.14159265359

ll multi5(ll x) {
    return pow(x, 5);
}

int main() {
    // input
    ll N, A, B, C;
    cin >> N >> A >> B >> C;
    vector<string> s(N);
    rep(i, N) {
        cin >> s[i];
    }

    string output = "";

    // process
    bool flag = true;
    rep(i, N) {
        if (s[i] == "AB") {
            if (A == 0) {
                if (B == 0) {
                    flag = false;
                    break;
                } else {
                    output += "A\n";
                    A++;
                    B--;
                    continue;
                }
            } else if (B == 0) {
                output += "B\n";
                B++;
                A--;
                continue;
            } else if (A == 1) {
                if (B == 1) {
                    if (s[i + 1] == "AC") {
                        output += "A\n";
                        A++;
                        B--;
                        continue;
                    } else if (s[i + 1] == "BC") {
                        output += "B\n";
                        B++;
                        A--;
                        continue;
                    }
                }
            } else if (B == 1) {
                output += "B\n";
                B++;
                A--;
                continue;
            }

            output += "A\n";
            A++;
            B--;

        } else if (s[i] == "AC") {
            if (A == 0) {
                if (C == 0) {
                    flag = false;
                    break;
                } else {
                    output += "A\n";
                    A++;
                    C--;
                    continue;
                }
            } else if (C == 0) {
                output += "C\n";
                C++;
                A--;
                continue;
            } else if (A == 1) {
                if (C == 1) {
                    if (s[i + 1] == "AB") {
                        output += "A\n";
                        A++;
                        C--;
                        continue;
                    } else if (s[i + 1] == "BC") {
                        output += "C\n";
                        C++;
                        A--;
                        continue;
                    }
                }
            } else if (C == 1) {
                output += "C\n";
                C++;
                A--;
                continue;
            }

            output += "A\n";
            A++;
            C--;

        } else if (s[i] == "BC") {
            if (B == 0) {
                if (C == 0) {
                    flag = false;
                    break;
                } else {
                    output += "B\n";
                    B++;
                    C--;
                    continue;
                }
            } else if (C == 0) {
                output += "C\n";
                C++;
                B--;
                continue;
            } else if (B == 1) {
                if (C == 1) {
                    if (s[i + 1] == "AC") {
                        output += "C\n";
                        C++;
                        B--;
                        continue;
                    } else if (s[i + 1] == "AB") {
                        output += "B\n";
                        B++;
                        C--;
                        continue;
                    }
                }
            } else if (C == 1) {
                output += "C\n";
                C++;
                B--;
                continue;
            }

            output += "B\n";
            B++;
            C--;

        }
    }

    if (flag) {
        cout << "Yes" << endl << output;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 6832