#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;


struct POS {
    POS(int _a = -1, int _b = -1, int _c = -1, char o = ' ') : a(_a), b(_b), c(_c), op(o) {
    }
    short a, b, c;
    char op;
};


int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;
    int a, b, c;
    cin >> a >> b >> c;

    const int N = 5;
    vector<vector<vector<vector<bool>>>> dp(n + 1, vector<vector<vector<bool>>>(N + 1, vector<vector<bool>>(N + 1, vector<bool>(N + 1, false))));
    dp[0][min(N, a)][min(N, b)][min(N, c)] = true;

    vector<vector<vector<vector<POS>>>> pre(n + 1, vector<vector<vector<POS>>>(N + 1, vector<vector<POS>>(N + 1, vector<POS>(N + 1))));


    string s;

    vector<vector<int>> ops {
        {1, -1, 0},
        {-1, 1, 0},
        {1, 0, -1},
        {-1, 0, 1},
        {0, 1, -1},
        {0, -1, 1}
    };

    vector<string> choices {"AB", "AC", "BC"};
    vector<int> CS;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        for (int j = 0; j < choices.size(); ++j) {
            if (choices[j] == s) {
                CS.push_back(j);
                for (int a = 0; a <= N; ++a) {
                    for (int b = 0; b <= N; ++b) {
                        for (int c = 0; c <= N; ++c) {
                            if (dp[i][a][b][c]) {
                                for (int l = j * 2; l < j * 2 + 2; ++l) {
                                     int na = a + ops[l][0], nb = b + ops[l][1], nc = c + ops[l][2];
                                     if (na >= 0 && nb >= 0 && nc >= 0) {
                                         na = min(na, N);
                                         nb = min(nb, N);
                                         nc = min(nc, N);
                                         dp[i + 1][na][nb][nc] = true;
                                         pre[i + 1][na][nb][nc] = POS(a, b, c, s[l - j * 2]);
                                     }

                                }
                            }
                        }
                    }
                }
                break;
            }
        }
    }

    string res;

    int A = -1, B = -1, C = -1;
    {
        bool done = false;
        for (int a = 0; a <= N && !done; ++a) {
            for (int b = 0; b <= N && !done; ++b) {
                for (int c = 0; c <= N && !done; ++c) {
                    if (dp[n][a][b][c]) {
                        A = a, B = b, C = c;
                        done = true;
                        break;
                    }
                }
            }
        }

        // cout << A << " " << B << " " << C << endl;
        if (A == -1) {
            cout << "No\n";
            return 0;
        }
        for (int i = n; i > 0; --i) {
            res += pre[i][A][B][C].op;
            int na = pre[i][A][B][C].a;
            int nb = pre[i][A][B][C].b;
            int nc = pre[i][A][B][C].c;
            A = na, B = nb, C = nc;
        }
    }



    // cout << res << endl;
    if (res.length() != n) {
        cout << "No\n";
    } else {
        cout << "Yes\n";
        for (int i = n - 1; i >= 0; --i) {
            cout << res[i] << "\n";
        }
    }

    return 0;
}

Measured memory_bytes: 621036