//----------------------------templates
    #pragma GCC optimize ("Ofast")
    #ifdef ONLINE_JUDGE
        #pragma GCC target ("avx512f")
    #else
        #pragma GCC target ("avx")
    #endif
    //----------------------------
    #include <bits/stdc++.h>
    using namespace std;

    typedef long long ll;
    typedef unsigned long long ull;
    #define int ll

    #define FOR(i,j,n) for (int i=(int)(j);i<(n);i++)
    #define REP(i,n) for (int i=0;i<(int)(n);i++)
    #define REPS(i,n) for (int i=1;i<=(int)(n);i++)
    #define REPN(i,n) for (int i=(int)(n)-1;i>=0;i--)
    #define REPNS(i,n) for (int i=(int)(n);i>0;i--)

    #define I(n) scanf("%lld", &(n))
    #define LL(n) scanf("%lld", &(n))
    #define pb(n) push_back((n))
    #define mp(i,j) make_pair((i),(j))
    #define eb(i,j) emplace_back((i),(j))
    #define y0 y3487465
    #define y1 y8687969
    #define j0 j1347829
    #define j1 j234892
    #define uniq(v) v.erase( unique(v.begin(), v.end()), v.end() )

    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())

    typedef vector<int> vi;
    typedef pair<int,int> pi;
    typedef vector<pi> vpi;
    typedef vector<vi> vvi;
    typedef vector<vpi> vvpi;
    typedef vector<vvi> vvvi;

    const int mod = 1000000007;

//--------------------------------------------

int n,a,b,c;
vector<string> order;
string s;
vector<char> ans;

int exec(int idx){
    string q = order[idx];
    if (q == "AB"){
        if (a == 0 && b == 0){
            cout << "No" << endl;
            return -1;
        }
        if (a < b){
            a++; b--;
            ans[idx] = 'A';
            return idx+1;
        } else if (a > b){
            a--; b++;
            ans[idx] = 'B';
            return idx+1;
        } else {
            if (q == order[idx+1]){
                ans[idx] = 'A';
                ans[idx+1] = 'B';
                return idx + 2;
            } 
            if (order[idx+1][0] == 'A'){
                a++; b--;
                ans[idx] = 'A';
                return idx+1;
            } else {
                a--; b++;
                ans[idx] = 'B';
                return idx+1;
            }
        }
    }
    if (q == "AC"){
        if (a == 0 && c == 0){
            cout << "No" << endl;
            return -1;
        }
        if (a < c){
            a++; c--;
            ans[idx] = 'A';
            return idx+1;
        } else if (a > c){
            a--; c++;
            ans[idx] = 'C';
            return idx+1;
        } else {
            if (q == order[idx+1]){
                ans[idx] = 'A';
                ans[idx+1] = 'C';
                return idx + 2;
            } 
            if (order[idx+1][0] == 'A'){
                a++; c--;
                ans[idx] = 'A';
                return idx+1;
            } else {
                a--; c++;
                ans[idx] = 'C';
                return idx+1;
            }
        }
    }
    if (q == "BC"){
        if (b == 0 && c == 0){
            cout << "No" << endl;
            return -1;
        }
        if (b < c){
            b++; c--;
            ans[idx] = 'B';
            return idx+1;
        } else if (b > c){
            b--; c++;
            ans[idx] = 'C';
            return idx+1;
        } else {
            if (q == order[idx+1]){
                ans[idx] = 'B';
                ans[idx+1] = 'C';
                return idx + 2;
            } 
            if (order[idx+1][1] == 'B'){
                b++; c--;
                ans[idx] = 'B';
                return idx+1;
            } else {
                b--; c++;
                ans[idx] = 'C';
                return idx+1;
            }
        }
    }
    return -1;
}



signed main(){
    cin >> n >> a >> b >> c;
    ans.resize(n);
    REP(i,n){
        cin >> s;
        order.pb(s);
    }
    order.pb("banpei");
    // 連続した操作がないことを保証したい

    int idx = 0;
    while(idx < n){
        idx = exec(idx);
        if (idx < 0) return 0;
    }
    cout << "Yes" << endl;
    for(auto c: ans){
        cout << c << endl;
    }
}

Measured memory_bytes: 7528