import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    //nextLineとnextを同時に使ったら死ぬ
    val sc = new Scanner(System.in)

    var n, a, b, c = sc.nextInt()
    val s = Array.fill(n)(sc.next())

    val ans = new StringBuilder()
    s.foreach {
      case "AB" =>
        if (a > b) {
          a -= 1
          b += 1
          ans.append("B\n")
        } else {
          a += 1
          b -= 1
          ans.append("A\n")
        }
      case "AC" =>
        if (a < c) {
          c -= 1
          a += 1
          ans.append("A\n")
        } else {
          a -= 1
          c += 1
          ans.append("C\n")
        }
      case _ =>
        if (b > c) {
          c += 1
          b -= 1
          ans.append("C\n")
        } else {
          b += 1
          c -= 1
          ans.append("B\n")
        }
    }
    
    if (a < 0 || b < 0 || c < 0) {
      println("No")
    } else {
      println("Yes")
      println(ans)
    }
  }

  def debug(args: Any*): Unit = {
    Console.err.println(args.mkString(" "))
  }

  def printExecTime(process: => Unit): Unit = {
    val start = System.currentTimeMillis
    process
    debug("処理時間： " + (System.currentTimeMillis - start) + " ミリ秒")
  }

}
