

import java.util.*

fun main() {
    val (n,a,b,c) = readLine()!!.split(" ").map { it.toInt() }
    val queries = Array(n){""}
    val sets = Array(3){ TreeSet<Int>() }
    val arr = IntArray(3)
    val m = charArrayOf('A','B','C')
    val ans = CharArray(n)

    arr[0] = a
    arr[1] = b
    arr[2] = c

    for(i in 0 until n) {
        queries[i] = readLine()!!
        for(v in queries[i]) {
            val d = v - 'A'
            sets[d].add(i)
        }
    }

    for(i in 0 until n) {
        val q = queries[i]
        val l = q[0] - 'A'
        val r = q[1] - 'A'
        var select = -1

        if(arr[l] > arr[r]) {
            arr[l]--
            arr[r]++
            select = r
        } else if(arr[l]<arr[r]) {
            arr[l]++
            arr[r]--
            select = l
        } else  {
            val nl = sets[l].higher(i) ?: Int.MAX_VALUE
            val nr = sets[r].higher(i) ?: Int.MAX_VALUE
            if(nl < nr) {
                arr[r]--
                arr[l]++
                select = l
            } else {
                arr[r]++
                arr[l]--
                select = r
            }
        }
        if(arr[l] < 0 || arr[r] < 0) {
            print("No")
            return
        }
        ans[i] = m[select]
    }
    println("Yes")
    for(i in 0 until n) {
        println(ans[i])
    }
    // 서로 갯수가 같으면
    // 다음번에 나올 횟수가 가장 적은 녀석으로?


}