program fm
  implicit none
  integer::N
  integer::a,b,c
  character(2),allocatable,dimension(:)::S
  character,allocatable,dimension(:)::ans
  logical::AB,BC,CA
  integer::i
  read*,N,a,b,c
  allocate(S(N))
  do i=1,N
    read*,S(i)
  end do
  if(a>=2)then
    AB=.true.
    CA=.false.
  else
    if(a==0.or.b>=2)then
      AB=.false.
    else
      AB=.true.
    endif
    if(a==0.or.c>=2)then
      CA=.false.
    else
      CA=.true.
    endif
  endif
  if(b>=2.or.c==0)then
    BC=.true.
  else
    if(b==c.and.b==1.and. .not.(AB))then
      BC=.false.
    else
      BC=.true.
    endif
  endif

  allocate(ans(N))
  do i=1,N
    if(S(i)=="AB")then
      if(AB)then
        a=a-1;b=b+1
        ans(i)="A"
      else
        a=a+1;b=b-1
        ans(i)="B"
      endif
      AB=.not.AB
    else if(S(i)=="BC")then
      if(BC)then
        b=b-1;c=c+1
        ans(i)="B"
      else
        b=b+1;c=c-1
        ans(i)="C"
      endif
      BC=.not.BC
    else
      if(CA)then
        c=c-1;a=a+1
        ans(i)="C"
      else
        c=c+1;a=a-1
        ans(i)="A"
      endif
      CA=.not.CA
    endif
  if(a<0.or.b<0.or.c<0)then
    print"(A)","No"
    stop
  endif
end do
print"(A)","Yes"
do i=1,N
  print"(A)",ANS(i)
end do
end program fm