#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second
#define endl "\n"

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef pair<int, int> P;


void step(char x, char y, ll& xv, ll& yv){
    if(xv == 0){
        xv++;
        yv--;
        cout << x << endl;
        return;
    }
    if(yv == 0){
        yv++;
        xv--;
        cout << y << endl;
        return;
    }

    if(xv > 1){
        xv--; yv++;
        cout << y << endl;
    }
    else{
        yv--; xv++;
        cout << x << endl;
    }
}

void sim(ll a, ll b, ll c, vector<string>& s){
    for(auto x: s){
        if(x == "AB"){
            step('A', 'B', a, b);
        }
        else if(x == "BC"){
            step('B', 'C', b, c);
        }
        else{
            step('A', 'C', a, c);
        }
    }
}


bool sim2(ll a, ll b, ll c, vector<string>& s, vector<char>& res){
    for(int i = 0; i < s.size(); i++){
        string x = s[i];
        if(x == "AB"){
            if(a == 0 && b == 0){
                return false;
            }
            else if(a == 0){
                res.push_back('A');
                a++; b--;
            }
            else if(b == 0){
                res.push_back('B');
                a--; b++;
            }
            else if(i+1 < s.size()){
                string y = s[i+1];
                if(y == "BC"){
                    res.push_back('B');
                    b++; a--;
                }
                else if(y == "AC"){
                    res.push_back('A');
                    a++; b--;
                }
                else{
                    res.push_back('A');
                    a++; b--;
                }
            }
            else{
                res.push_back('A');
                a++; b--;
            }
        }
        else if(x == "BC"){
            if(b == 0 && c == 0){
                return false;
            }
            else if(b == 0){
                res.push_back('B');
                b++; c--;
            }
            else if(c == 0){
                res.push_back('C');
                b--; c++;
            }
            else if(i+1 < s.size()){
                string y = s[i+1];
                if(y == "AB"){
                    res.push_back('B');
                    b++; c--;
                }
                else if(y == "AC"){
                    res.push_back('C');
                    c++; b--;
                }
                else{
                    res.push_back('B');
                    b++; c--;
                }
            }
            else{
                res.push_back('B');
                b++; c--;
            }
        }
        else if(x == "AC"){
            if(a == 0 && c == 0){
                return false;
            }
            else if(a == 0){
                res.push_back('A');
                a++; c--;
            }
            else if(c == 0){
                res.push_back('C');
                a--; c++;
            }
            else if(i+1 < s.size()){
                string y = s[i+1];
                if(y == "AB"){
                    res.push_back('A');
                    a++; c--;
                }
                else if(y == "BC"){
                    res.push_back('C');
                    c++; a--;
                }
                else{
                    res.push_back('A');
                    a++; c--;
                }
            }
            else{
                res.push_back('A');
                a++; c--;
            }
        }
    }
    return true;
}


int main(){
    ll n, a, b, c;
    cin >> n >> a >> b >> c;
    vector<string> s(n);
    for(int i = 0; i < n; i++){
        cin >> s[i];
    }

    if(((a > 0 && b > 0) || (b > 0 && c > 0) || (c > 0 && a > 0)) && (a + b + c > 2)){
        cout << "Yes" << endl;
        sim(a, b, c, s);
    }
    else if(a + b + c == 0){
        cout << "No" << endl;
    }
    else{
        vector<char> res;
        bool p = sim2(a, b, c, s, res);
        if(p){
            cout << "Yes" << endl;
            for(auto cc: res){
                cout << cc << endl;
            }
        }
        else{
            cout << "No" << endl;
        }
    }


    return 0;
}


Measured memory_bytes: 6732