// #pragma GCC optimize(3,"Ofast","inline")
// #pragma GCC optimize(2)
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <string>
#include <iostream>
#include <list>
#include <cstdlib>
#include <bitset>
#include <assert.h>
#include <time.h>
#include <iomanip>
// #define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
// char buf[(1 << 21) + 1], * p1 = buf, * p2 = buf;
// #define int long long
#define lowbit(x) (x & (-x))
#define lson root << 1, l, mid
#define rson root << 1 | 1, mid + 1, r
#define pb push_back
typedef unsigned long long ull;
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll, ll> pll;
#define bug puts("BUG")
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const int inf = 0x3f3f3f3f;
const int mod = 998244353;
const double eps = 1e-6;
template <class T>
inline void read(T &x)
{
    int sign = 1;char c = getchar();x = 0;
    while (c > '9' || c < '0'){if (c == '-')sign = -1;c = getchar();}
    while (c >= '0' && c <= '9'){x = x * 10 + c - '0';c = getchar();}
    x *= sign;
}
#ifdef LOCAL
    FILE* _INPUT=freopen("input.txt", "r", stdin);
    // FILE* _OUTPUT=freopen("output.txt", "w", stdout);
#endif
using namespace std;
const int maxn = 1e5 + 10;
char s[maxn][5];
int main(){
    int n,a,b,c;
    read(n), read(a), read(b), read(c);
    for (int i = 1; i <= n; i++)
        scanf("%s", s[i] + 1);
    vector<char> ans;
    for (int i = 1; i <= n; i++)
    {
        if(s[i][1]=='A'&&s[i][2]=='B'){
            if(a>b){
                a--;b++;
                ans.push_back('B');
            }
            else if(a<b){
                a++;b--;
                ans.push_back('A'); 
            }
            else {
                if(s[i+1][1]=='A'){
                    a++;b--;
                    ans.push_back('A');
                }
                else{
                    a--;b++;
                    ans.push_back('B');
                }
            }
        }
        else if(s[i][1]=='A'&&s[i][2]=='C'){
            if(a>c){
                a--;c++;
                ans.push_back('C');
            }
            else if(a<c){
                a++;c--;
                ans.push_back('A'); 
            }
            else {
                if(s[i+1][1]=='A'){
                    a++;c--;
                    ans.push_back('A');
                }
                else{
                    a--;c++;
                    ans.push_back('C');
                }
            }
        }
        else {
            if(b>c){
                b--;c++;
                ans.push_back('C');
            }
            else if(b<c){
                b++;c--;
                ans.push_back('B'); 
            }
            else {
                if(s[i+1][2]=='C'){
                    b--;c++;
                    ans.push_back('C');
                }
                else{
                    b++;c--;
                    ans.push_back('B');
                }
            }
        } 
        if(a<0||b<0||c<0)
            return cout << "No" << endl, 0;
    }
    puts("Yes");
    int t=ans.size();
    for (int i = 0; i < t; i++)
    {
        cout << ans[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 4324