#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
int main(void)
{
    ll n, a, b, c;
    int i;
    int out = 0;
    char s[3];
    char ans[110000];
    scanf("%lld%lld%lld%lld", &n, &a, &b, &c);
    for (i = 0; i < n; i++)
    {
        scanf("%s", s);
        if (!strcmp(s, "AB"))
        {
            if (a > b)
            {
                a--;
                b++;
                ans[i] = 'B';
            }
            else
            {
                if (b == 0)
                    out = 1;
                a++;
                b--;
                ans[i] = 'A';
            }
        }
        else if (!strcmp(s, "AC"))
        {
            if (a > c)
            {
                a--;
                c++;
                ans[i] = 'C';
            }
            else
            {
                if (c == 0)
                    out = 1;
                a++;
                c--;
                ans[i] = 'A';
            }
        }
        else
        {
            if (b > c)
            {
                b--;
                c++;
                ans[i] = 'C';
            }
            else
            {
                if (c == 0)
                    out = 1;
                b++;
                c--;
                ans[i] = 'B';
            }
        }
    }
    if (out)
        printf("No\n");
    else
    {
        printf("Yes\n");
        for (i = 0; i < n; i++)
        {
            printf("%c\n", ans[i]);
        }
    }
    return 0;
}