Scanf.scanf "%d %d %d %d" (fun n a b c ->
    let s = Array.init n (fun _ -> read_line ()) in 
    let ans = Array.make n "" in

    let rec loop i a b c =
        if i = n then true else
            match s.(i) with
            | "AB" -> if a = 0 && b = 0 then false else
                      if a = 0 then (ans.(i) <- "A";    loop (i + 1) (a + 1) (b - 1) c) else
                      if b = 0 then (ans.(i) <- "B";    loop (i + 1) (a - 1) (b + 1) c) else
                                    (ans.(i) <- "A"; if loop (i + 1) (a + 1) (b - 1) c then true else 
                                    (ans.(i) <- "B";    loop (i + 1) (a - 1) (b + 1) c))
            | "BC" -> if b = 0 && c = 0 then false else
                      if b = 0 then (ans.(i) <- "B";    loop (i + 1) a (b + 1) (c - 1)) else
                      if c = 0 then (ans.(i) <- "C";    loop (i + 1) a (b - 1) (c + 1)) else
                                    (ans.(i) <- "B"; if loop (i + 1) a (b + 1) (c - 1) then true else 
                                    (ans.(i) <- "C";    loop (i + 1) a (b - 1) (c + 1)))
            | "AC" -> if a = 0 && c = 0 then false else
                      if a = 0 then (ans.(i) <- "A";    loop (i + 1) (a + 1) b (c - 1)) else
                      if c = 0 then (ans.(i) <- "C";    loop (i + 1) (a - 1) b (c + 1)) else
                                    (ans.(i) <- "A"; if loop (i + 1) (a + 1) b (c - 1) then true else 
                                    (ans.(i) <- "C";    loop (i + 1) (a - 1) b (c + 1)))
            | _ -> failwith "??"

    in
    if loop 0 a b c then (print_endline "Yes"; Array.iter print_endline ans)
                    else print_endline "No"
)