program sample
    implicit none
    real(8)::x,y,z
    integer(8) :: a,b,c,i,j,m,n,k,a1,b1,c1
    character,allocatable ::s(:) !文字列
    
  
    read(*,*)n,a,b
    allocate(s(n))
    read(*,*)s
    a1=0
    b1=0

    do i=1,n
        if (s(i)=='a')then
            if (a1+b1<a+b)then
                a1=a1+1
                write(*,*)'Yes'
            else
                write(*,*)'No'
            end if
        else if (s(i)=='b')then
            if (a1+b1<a+b)then
                if (b1<b)then
                    b1=b1+1
                    write(*,*)'Yes'
                end if
            else
                write(*,*)'No'
            end if
           

        else
            write(*,*)'No'
        end if

    end do
    
    stop
end program sample
  

