module IntTripleMap = Map.Make (struct
  type t = int
  let compare = compare
end)

let () = Scanf.scanf "%d %d %d %d\n" @@ fun n a b c ->
  let ss = List.init n @@ fun _ -> Scanf.scanf "%s\n" Fun.id in
  try
    let (_, acc) =
      List.fold_left (fun ((a, b, c), acc) -> function
        | "AB" ->
            if a = 0 && b = 0 then raise Not_found;
            if a <= b
            then ((a + 1, b - 1, c), "A" :: acc)
            else ((a - 1, b + 1, c), "B" :: acc)
        | "AC" ->
            if a = 0 && c = 0 then raise Not_found;
            if a <= c
            then ((a + 1, b, c - 1), "A" :: acc)
            else ((a - 1, b, c + 1), "C" :: acc)
        | "BC" ->
            if b = 0 && c = 0 then raise Not_found;
            if b <= c
            then ((a, b + 1, c - 1), "B" :: acc)
            else ((a, b - 1, c + 1), "C" :: acc)) ((a, b, c), []) ss in
    print_endline "Yes";
    List.iter print_endline (List.rev acc)
  with Not_found -> print_endline "No"

