import java.util.Scanner

object Main extends App {
  val ABC = Array("A", "B", "C")
  def printABC(n: Int): Unit = {
    println(ABC(n))
  }

  val sc = new Scanner(System.in)
  val n = sc.nextInt()
  val (a, b, c) = (sc.nextInt(), sc.nextInt(), sc.nextInt())
  val ss = (1 to n).map { _ =>
    val s = sc.next()
    S.find(s)
  }

  var state = State(Array(a, b, c), Nil)
  ss.zipWithIndex.foreach { case (s, idx) =>
    val targetSum = state.targetSum(s)
    if(targetSum == 0) {
      println("No")
      sys.exit(0)
    } else if(state.isHeadZero(s)) {
      state = state.addHead(s)
    } else if(state.isLastZero(s)) {
      state = state.addLast(s)
    } else {
      ss.lift(idx).fold { state = state.exec(s) } { nextS =>
        val dup = s.dup(nextS)
        state = state.add(dup, s)
      }
    }
  }
  println("Yes")
  state.result.foreach(printABC)

}

case class State(ary: Array[Int], reverse: List[Int]) {
  if(ary.exists(_ < 0)) throw new IllegalStateException(s"from State (ary: ${ary.mkString(",")})")
  def exec(s: S): State = {
    if(isHeadZero(s)) addHead(s)
    else addLast(s)
  }

  def isHeadZero(s: S): Boolean = ary(s.target.head) == 0
  def isLastZero(s: S): Boolean = ary(s.target.last) == 0

  def targetSum(s: S): Int = s.target.map(ary(_)).sum
  def sum: Int = ary.sum

  def addHead(s: S): State = {
    val i = s.target.head
    val j = s.target.last
    val nextAry = ary.clone()
    nextAry(i) += 1
    nextAry(j) -= 1
    State(nextAry, i :: reverse)
  }

  def addLast(s: S): State = {
    val i = s.target.head
    val j = s.target.last
    val nextAry = ary.clone()
    nextAry(i) -= 1
    nextAry(j) += 1
    State(nextAry, j :: reverse)
  }

  // 0 <= elem <= 2
  def add(elem: Int, s: S): State = {
    if(s.target.head == elem) addHead(s)
    else if(s.target.last == elem) addLast(s)
    else throw new RuntimeException(s"Error from add(${elem}, ${s})")
  }

  def last(s: S): Int = s.target.last

  def result: List[Int] = reverse.reverse
}

sealed abstract class S {
  lazy val name: String = getClass.getSimpleName.init

  def target: Array[Int]

  def dup(s: S): Int = (target.toSet & s.target.toSet).head
}

object S {
  case object AB extends S {
    override val target: Array[Int] = Array(0, 1)
  }

  case object AC extends S {
    override val target: Array[Int] = Array(0, 2)
  }

  case object BC extends S {
    override val target: Array[Int] = Array(1, 2)
  }

  val values: Seq[S] = AB :: AC :: BC :: Nil
  def find(name: String): S = values.find(_.name == name).get
}
