#include <functional>  
#include <algorithm>  
#include <iostream>  
#include <fstream>  
#include <sstream>  
#include <iomanip>  
#include <numeric>  
#include <cstring>  
#include <cassert>  
#include <cstdio>  
#include <string>  
#include <vector>  
#include <bitset>  
#include <queue>  
#include <stack>  
#include <cmath>  
#include <ctime>  
#include <list>  
#include <set>  
#include <map>  
#include <climits>

using namespace std;

#define PB push_back  
#define MP(A, B) make_pair(A, B)  
#define fi first  
#define se second  

#define gcd(a,b) __gcd(a,b)
#define pi acos(-1.0)
#define pii pair<int,int>
#define ll long long  
#define MAX 1000005  
#define MOD 1000000007  
#define INF 0x3f3f3f3f  
#define EXP 1e-8  
#define lowbit(x) (x&-x)  
ll qpow(ll p,ll q){ll f=1;while(q){if(q&1)f=f*p;p=p*p;q>>=1;}return f;}

struct hash_pair { 
    template <class T1, class T2> 
    size_t operator()(const pair<T1, T2>& p) const
    { 
        auto hash1 = hash<T1>{}(p.first); 
        auto hash2 = hash<T2>{}(p.second); 
        return hash1 ^ hash2; 
    } 
}; 

ll GCD(ll a, ll b)  
{  
    return b ? GCD(b, a % b) : a;  
}  
const int PRIMERANGE = 1000000;  
int prime[PRIMERANGE + 1];  
int getPrime()  
{  
    memset (prime, 0, sizeof (int) * (PRIMERANGE + 1));  
    for (int i = 2; i <= PRIMERANGE; i++)  
    {  
        if (!prime[i]) prime[++prime[0]] = i;  
        for (int j = 1; j <= prime[0] && prime[j] <= PRIMERANGE / i; j++)  
        {  
            prime[prime[j]*i] = 1;  
            if (i % prime[j] == 0) break;  
        }  
    }  
    return prime[0];  
}  
/*************************************** 
get factor of n 
O(sqrt(n)) 
factor[][0] is prime factor 
factor[][1] is factor generated by this prime 
factor[][2] is factor counter 

need: Prime Table 
***************************************/  
///you should init the prime table before  
int factor[100][3], facCnt;  
int getFactors(int x)  
{  
    facCnt = 0;  
    int tmp = x;  
    for(int i = 1; prime[i] <= tmp / prime[i]; i++)  
    {  
        factor[facCnt][1] = 1, factor[facCnt][2] = 0;  
        if(tmp % prime[i] == 0)  
            factor[facCnt][0] = prime[i];  
        while(tmp % prime[i] == 0)  
            factor[facCnt][2]++, factor[facCnt][1] *= prime[i], tmp /= prime[i];  
        if(factor[facCnt][1] > 1) facCnt++;  
    }  
    if(tmp != 1)  
        factor[facCnt][0] = tmp, factor[facCnt][1] = tmp, factor[facCnt++][2] = 1;  
    return facCnt;  
}  

bool test(ll v) {
    
}

void dfs(int fac, int v, int flag) {
    if(flag) {
        cout << v << endl;
        test(v);
    }
    if (fac >= facCnt) {
        return;
    }
    for (int i = 0; i <= factor[fac][2]; ++i) {
        dfs(fac+1, v*qpow(factor[fac][0], i), i==0?0:1);
    }
}

ll A[100005], b, x, n;
int main()
{
    cin >> n;
    cin >> A[0] >> A[1] >> A[2];
    string ans;
            int a, b;
            int la, lb;
    if (A[0]+A[1]+A[2]==2) {
        string o, lo; vector<string> os;
        for (int i = 0; i < n; ++i) {cin >> o; os.push_back(o);}
        for (int i = 1; i <= n; ++i) {
            if (i < n) 
            {
                lo = os[i-1]; o = os[i];
                la = lo[0]-'A'; lb = lo[1]-'A';
                a = o[0]-'A'; b = o[1]-'A';
                // cout << o << ' ' << lo << endl;
            } else {
                lo = os[n-1];
                la = lo[0]-'A'; lb = lo[1]-'A';
            }
            if (A[la] == A[lb] && A[la] == 0) {cout << "No" << endl; return 0;}

            if (A[la] == A[lb] && o != lo && i != n) {
                if (la == a || la == b) {
                    A[la]++; A[lb]--;
                    // cout << "??" << endl;
                    ans.push_back(la+'A');
                }
                if (lb == a || lb == b) {
                    A[lb]++; A[la]--;
                    ans.push_back(lb+'A');
                }
            } else {
                if (A[la] > A[lb]) {
                    A[lb]++; A[la]--;
                    ans.push_back(lb+'A');
                } else {
                    A[la]++; A[lb]--;
                    ans.push_back(la+'A');
                }
            }
        } 
        cout << "Yes" << endl;
        for (int i = 0; i < ans.size(); ++i) {
            cout << ans[i] << endl;
        }

    }else {
        for (int i = 0 ; i < n; ++i) {
            string o; cin >> o;
                int a, b;
            if (o == "AB") {
                a = 0;  b= 1;
            }
            if (o == "AC") {
                a = 0;  b= 2;
            }
            if (o == "BC") {
                a = 1;  b= 2;
            }
            if (A[a] == 0 && A[b] == 0) {
                cout << "No" << endl;
                return 0;
            }
            if (A[a] > A[b]) {
                A[a]--; A[b]++;
                ans.push_back(o[1]);
            } else {
                A[b]--; A[a]++;
                ans.push_back(o[0]);
            }
        }
        cout << "Yes" << endl;
        for (int i = 0; i < ans.size(); ++i) {
            cout << ans[i] << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 7468