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 Array(i, j) = s.target
    if(state(i) + state(j) <= 0) {
      println("No")
      sys.exit(0)
    }
    state = if(state(i) == 0) state.add(i, j)
    else if(state(j) == 0) state.add(j, i)
    else {
      ss.lift(idx + 1).fold { state.add(i, j) } { nextS =>
        if(nextS.target.contains(i)) state.add(i, j) else state.add(j, i)
      }
    }
  }
  println("Yes")
  state.result.reverse.foreach(printABC)

}

case class State(ary: Array[Int], result: List[Int]) {
  def add(incr: Int, decr: Int): State = {
    val nextAry = ary.clone()
    nextAry(incr) += 1
    nextAry(decr) -= 1
    State(nextAry, incr :: result)
  }

  def apply(n: Int): Int = ary(n)
}

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

  def target: Array[Int]
}

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
}
