let rec solve a b c acc ss =
  if a < 0 || b < 0 || c < 0 then raise Not_found;
  match ss with
  | [] -> acc
  | "AB" :: rest ->
      begin try solve (a + 1) (b - 1) c ('A' :: acc) rest with
      | Not_found -> solve (a - 1) (b + 1) c ('B' :: acc) rest
      end
  | "AC" :: rest ->
      begin try solve (a + 1) b (c - 1) ('A' :: acc) rest with
      | Not_found -> solve (a - 1) b (c + 1) ('C' :: acc) rest
      end
  | "BC" :: rest ->
      begin try solve a (b + 1) (c - 1) ('B' :: acc) rest with
      | Not_found -> solve a (b - 1) (c + 1) ('C' :: acc) rest
      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 ans = solve a b c [] ss in
    print_endline "Yes";
    List.iter (Printf.printf "%c\n") (List.rev ans)
  with Not_found -> print_endline "No"

