
object Main {
  
  def main(args: Array[String]): Unit = {
    val Array(n, a, b, c) = io.StdIn.readLine().split(" ").map(_.toInt)

    val actions = for{ i <- 0 until n} yield { io.StdIn.readLine() match {
      case "AB" => (0,1)
      case "BC" => (1,2)
      case "AC" => (0,2)
    }}

    val total = a + b + c


    val least = (Array(0,0,0),List[Int]()) :: Nil
    val done = actions.reverse.foldLeft(least)((least,action) => {
      least.flatMap(tuple => {
        val v = tuple._1
        val a = Array(v(0),v(1),v(2))
        a(action._1) += 1
        val b = Array(v(0),v(1),v(2))
        b(action._2) += 1
        (a, action._2 :: tuple._2) :: (b, action._1 :: tuple._2) :: Nil
      }).filter(tuple => {
        val v = tuple._1
        v(0) <= a && v(1) <= b && v(2) <= c
      })
    })

    if(done.length > 0) {
      println("Yes")
      done.head._2.foreach(_ match {
        case 0 => println("A")
        case 1 => println("B")
        case 2 => println("C")
      })
    } else {
      println("No")
    }

  }

}