using System;
using System.Linq;

namespace ProblemF
{
    class Program
    {
        static void Main(string[] args)
        {
            var buff = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = buff[0];
            int A = buff[1];
            int B = buff[2];
            int C = buff[3];
            var s = new string[N];
            for(int i = 0; i < N; i++)
            {
                s[i] = Console.ReadLine();
            }

            var ans = new string[N];

            for(int i = 0; i < N; i++)
            {
                switch(s[i])
                {
                    case "AB":
                        if(A <= B)
                        {
                            if (A == B && B == 1 && C == 0)
                            {
                                for(int j = i + 1; j < N; j++)
                                {
                                    if(s[j] == "BC")
                                    {
                                        ans[i] = "B";
                                        A--;
                                        B++;
                                        goto ENDLOOP;
                                    }
                                    else if(s[j] == "AC")
                                    {
                                        break;
                                    }
                                }
                            }
                            ans[i] = "A";
                            A++;
                            B--;
                        }
                        else
                        {
                            ans[i] = "B";
                            A--;
                            B++;
                        }
                        break;
                    case "AC":
                        if (A <= C)
                        {
                            if (A == C && C == 1 && B == 0)
                            {
                                for (int j = i + 1; j < N; j++)
                                {
                                    if (s[j] == "BC")
                                    {
                                        ans[i] = "C";
                                        A--;
                                        C++;
                                        goto ENDLOOP;
                                    }
                                    else if(s[j] == "AB")
                                    {
                                        break;
                                    }
                                }
                            }
                            ans[i] = "A";
                            A++;
                            C--;
                        }
                        else
                        {
                            ans[i] = "C";
                            A--;
                            C++;
                        }
                        break;
                    case "BC":
                        if (C <= B)
                        {
                            if (B == C && C == 1 && A == 0)
                            {
                                for (int j = i + 1; j < N; j++)
                                {
                                    if (s[j] == "AB")
                                    {
                                        ans[i] = "B";
                                        C--;
                                        B++;
                                        goto ENDLOOP;
                                    }
                                    else if(s[j] == "AC")
                                    {
                                        break;
                                    }
                                }
                            }
                            ans[i] = "C";
                            C++;
                            B--;
                        }
                        else
                        {
                            ans[i] = "B";
                            C--;
                            B++;
                        }
                        break;
                }
            ENDLOOP:;
                if(A < 0 || B < 0 || C < 0)
                {
                    Console.WriteLine("No");
                    return;
                }
            }
            Console.WriteLine("Yes");
            foreach(var str in ans)
            {
                Console.WriteLine(str);
            }
        }
    }
}


Measured memory_bytes: 33028