using System;
using System.Collections.Generic;
using System.Linq;

public class Solution
{
    static string NextIn0(ref long A, ref long B, ref long C, string s)
    {
        var ans = "";
        switch (s)
        {
            case "AB":
                if (A + B == 0)
                {
                    return null;
                }
                if (A == 0)
                {
                    ans = "A";
                }
                else
                {
                    ans = "B";
                }
                break;
            case "BC":
                if (B + C == 0)
                {
                    return null;
                }
                if (B == 0)
                {
                    ans = "B";
                }
                else
                {
                    ans = "C";
                }
                break;
            case "AC":
                if (A + C == 0)
                {
                    return null;
                }
                if (A == 0)
                {
                    ans = "A";
                }
                else
                {
                    ans = "C";
                }
                break;
        }

        Apply(ref A, ref B, ref C, s, ans);
        return ans;
    }

    static void Apply(ref long A, ref long B, ref long C, string s, string choice)
    {
        var notChoice = s.Replace(choice, "");
        switch (choice)
        {
            case "A":
                A++;
                break;
            case "B":
                B++;
                break;
            case "C":
                C++;
                break;
        }
        switch (notChoice)
        {
            case "A":
                A--;
                break;
            case "B":
                B--;
                break;
            case "C":
                C--;
                break;
        }
    }

    static string Next(ref long A, ref long B, ref long C, string next, string nnext)
    {
        if (nnext == null)
        {
            return NextIn0(ref A, ref B, ref C, next);
        }

        foreach (var c in "ABC")
        {
            if (next.Contains(c) && nnext.Contains(c))
            {
                var choice = c.ToString();
                Apply(ref A, ref B, ref C, next, choice);
                return choice;
            }
        }

        throw new Exception();
    }

    static int GetZeroCount(long A, long B, long C, string s)
    {
        int count = 0;
        foreach (var c in s)
        {
            switch (c)
            {
                case 'A':
                    if (A == 0)
                    {
                        count++;
                    }
                    break;
                case 'B':
                    if (B == 0)
                    {
                        count++;
                    }
                    break;
                case 'C':
                    if (C == 0)
                    {
                        count++;
                    }
                    break;
            }
        }
        return count;
    }

    public static void Main()
    {
        var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var N = vals[0];
        long A = vals[1];
        long B = vals[2];
        long C = vals[3];
        var S = new string[N];
        for (int i = 0; i < N; i++)
        {
            S[i] = Console.ReadLine();
        }

        if (A + B + C == 0)
        {
            Console.WriteLine("No");
            return;
        }

        var answer = new List<string>();

        if (A + B + C == 1)
        {
            foreach (var s in S)
            {
                var ans = NextIn0(ref A, ref B, ref C, s);
                if (ans == null)
                {
                    Console.WriteLine("No");
                    return;
                }
                answer.Add(ans);
            }
        }
        else
        {
            var first = S.First();
            if (GetZeroCount(A, B, C, first) == 2)
            {
                Console.WriteLine("No");
                return;
            }

            for (int i = 0; i < N; i++)
            {
                var s = S[i];
                if (GetZeroCount(A, B, C, s) == 1)
                {
                    var ans = NextIn0(ref A, ref B, ref C, s);
                    answer.Add(ans);
                }
                else
                {
                    string ss = i + 1 == N ? null : S[i + 1];
                    var ans = Next(ref A, ref B, ref C, s, ss);
                    answer.Add(ans);
                }
            }
        }

        Console.WriteLine("Yes");
        Console.WriteLine(string.Join(Environment.NewLine, answer));
    }
}

Measured memory_bytes: 39216