<?php


fscanf(STDIN, "%d%d%d%d", $N,$A,$B,$C);

$array = [];
$n = $N;
while($n--){
    fscanf(STDIN, "%s", $tmp);
    $array[] = $tmp;
}
$ans = [];
foreach($array as $key=>$value){
    if($value == "AB"){
        if($A == 0 && $B == 0){
            echo "No";
            exit;
        }
        if($A == 0){
            $A++;
            $B--;
            $ans[] = "A";
        }elseif($B == 0){
            $B++;
            $A--;
            $ans[] = "B";
        }else{
            if($A == 1 && $B == 1){
                if($key + 1 == $N){
                    $A++;
                    $B--;
                    $ans[] = "A";
                }elseif($array[$key + 1] == "AC" && $C <=1){
                    $A++;
                    $B--;
                    $ans[] = "A";
                }elseif($array[$key + 1] == "BC" && $C <=1){
                    $A--;
                    $B++;
                    $ans[] = "B";
                }else{
                    if($key % 2 == 0){
                        $A++;
                        $B--;
                        $ans[] = "A";
                    }else{
                        $A--;
                        $B++;
                        $ans[] = "B";
                    }
                }
            }elseif($A > $B){
                $A--;
                $B++;
                $ans[] = "B";
            }else{
                $A++;
                $B--;
                $ans[] = "A";
            }
        }
    }elseif($value == "BC"){

        if($C == 0 && $B == 0){
            echo "No";
            exit;
        }
        if($C == 0){
            $C++;
            $B--;
            $ans[] = "C";
        }elseif($B == 0){
            $B++;
            $C--;
            $ans[] = "B";
        }else{
            if($C == 1 && $B == 1){
                if($key + 1 == $N){
                    $C++;
                    $B--;
                    $ans[] = "C";
                }elseif($array[$key + 1] == "AC" && $A <=1){
                    $C++;
                    $B--;
                    $ans[] = "C";
                }elseif($array[$key + 1] == "AB" && $A <=1){
                    $C--;
                    $B++;
                    $ans[] = "B";
                }else{
                    if($key % 2 == 0){
                        $C++;
                        $B--;
                        $ans[] = "C";
                    }else{
                        $C--;
                        $B++;
                        $ans[] = "B";
                    }
                }
            }elseif($C > $B){
                $C--;
                $B++;
                $ans[] = "B";
            }else{
                $C++;
                $B--;
                $ans[] = "C";
            }
        }
    }else{//AC

        if($C == 0 && $A == 0){
            echo "No";
            exit;
        }
        if($C == 0){
            $C++;
            $A--;
            $ans[] = "C";
        }elseif($A == 0){
            $A++;
            $C--;
            $ans[] = "A";
        }else{
            if($C == 1 && $A == 1){
                if($key + 1 == $N){
                    $A++;
                    $C--;
                    $ans[] = "A";
                }elseif($array[$key + 1] == "BC" && $B <=1){
                    $C++;
                    $A--;
                    $ans[] = "C";
                }elseif($array[$key + 1] == "AB" && $B <=1){
                    $C--;
                    $A++;
                    $ans[] = "A";
                }else{
                    if($key % 2 == 0){
                        $C++;
                        $A--;
                        $ans[] = "C";
                    }else{
                        $C--;
                        $A++;
                        $ans[] = "A";
                    }
                }
            }elseif($C > $A){
                $C--;
                $A++;
                $ans[] = "A";
            }else{
                $C++;
                $A--;
                $ans[] = "C";
            }
        }
    }


}

echo"Yes".PHP_EOL;
echo implode(PHP_EOL,$ans);

Measured memory_bytes: 27384