Problem:
 Score : 200 points    Problem Statement There are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these.  Only Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy the conditions listed below, from the top rank down. Participants who are not students cannot pass the Qualification contests.   A Japanese student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B .  An overseas student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B and the student ranks B -th or above among all overseas students.   A string S is assigned indicating attributes of all participants. If the i -th character of string S is a , this means the participant ranked i -th in the Qualification contests is a Japanese student; b means the participant ranked i -th is an overseas student; and c means the participant ranked i -th is neither of these.  Write a program that outputs for all the participants in descending rank either Yes if they passed the Qualification contests or No if they did not pass.      Constraints  1≦N,A,B≦100000  A+B≦N  S is N characters long.  S consists only of the letters a , b and c .         Input Inputs are provided from Standard Input in the following form.  N  A  B  S       Output Output N lines. On the i -th line, output Yes if the i -th participant passed the Qualification contests or No if that participant did not pass.        Sample Input 1 10 2 3
abccabaabb      Sample Output 1 Yes
Yes
No
No
Yes
Yes
Yes
No
No
No  The first, second, fifth, sixth, and seventh participants pass the Qualification contests.       Sample Input 2 12 5 2
cabbabaacaba      Sample Output 2 No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No  The sixth participant is third among overseas students and thus does not pass the Qualification contests.       Sample Input 3 5 2 2
ccccc      Sample Output 3 No
No
No
No
No

Solution (Python):




import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter











N,A,B=map(int, input().split())
S = input()
tmp1 = 0
tmp2 = 0

for i in range(0,N):
    if tmp1 < A+B:
        if S[i] == "a":
            tmp1 += 1
            print("Yes")
        elif (S[i] == "b") & (tmp2 < B):
            tmp1 += 1
            tmp2 += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):
n,a,b = map(int, input().split())
s = input()
ya=0
yb=0
for c in s:
  if c=="a" and ya+yb<a+b:
    print("Yes")
    ya+=1
  elif c=="b"and ya+yb<a+b and yb<b:
    print("Yes")
    yb+=1
  else:
    print("No")

Solution (Python):
n,A,B=map(int,input().split())
contestant=list(input())
aa=0
bb=0
for i in range(n):
  if contestant[i]=="c":
    print("No")
  elif contestant[i]=="b":
    if aa+bb<A+B and bb<B:
      print("Yes")
      bb+=1
    else:
      print("No")
    
  elif contestant[i]=="a":
    if aa+bb<A+B:
      print("Yes")
    else:
      print("No")
    aa+=1

Solution (Python):
N, A, B = map(int, input().split(' '))
S = input()

passed_a = 0
passed_b = 0
ans = []
for i in range(N):
    if S[i] == 'a':
        if passed_a + passed_b < A + B:
            ans.append('Yes')
            passed_a += 1
        else:
            ans.append('No')

    if S[i] == 'b':
        if passed_a + passed_b < A + B and passed_b < B:
            ans.append('Yes')
            passed_b += 1
        else:
            ans.append('No')

    if S[i] == 'c':
        ans.append('No')

for _ in ans:
    print(_)

Solution (Python):
N,A,B = map(int,input().split())
S = input()
pas = 0
num = A + B
kaigai = 0
for i in range(len(S)):
    if S[i] == "a":
        if pas < num:
            pas += 1
            print("Yes")
        else:
            print("No")
    elif S[i] == "b":
        kaigai += 1
        if pas < num and kaigai <= B:
            pas += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):
n,a,b = map(int,input().split())
S = input()
passed = 0
f_passed = 0
for s in S:
  if s == "a":
    if passed < a + b:
      print("Yes")
      passed += 1
    else:
      print("No")
  elif s == "b":
    if passed < a + b and f_passed + 1 <= b:
      print("Yes")
      passed += 1
      f_passed += 1
    else:
      print("No")
  else:
    print("No")

Solution (Python):
N, A, B = map(int,input().split())
S = input()

temp_num_people = 0
temp_overseas = 0
for s,i in zip(S,range(len(S))):
    if s == 'a':
        if temp_num_people < A+B:
            print('Yes')
            temp_num_people+=1
        else:
            print('No')

    if s == 'b':
        if (temp_num_people < A+B) and (temp_overseas < B):
            print('Yes')
            temp_num_people+=1
            temp_overseas+=1
        else:
            print('No')

    if s == 'c':
        print('No')

Solution (Python):
n, a, b = map(int, input().split())

participants = input()

count = 0
b_count = 1
for participant in participants:

    if participant == "a" and count < a+b:
        print("Yes")
        count += 1
    elif participant == "b" and count < a+b:
        if b_count <= b:
            count += 1
            b_count += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):
n,a,b=map(int,input().split())
s=input()
c=a+b
A=0
B=0
for i in s:
    if A+B<c:
        if i=="a":
            A+=1
            print("Yes")
        elif i=="b" and B<b:
            B+=1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):


N, A, B = map(int, input().split())
S = list(str(input()))

total = 0
total_B = 0
for s in S:
    if s == 'a' and total < (A + B):
        total += 1
        print('Yes')
    elif s == 'b' and total < (A + B) and total_B < B:
        total += 1
        total_B += 1
        print('Yes')
    else:
        print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()
a = 0
b = 0
for char in S:
    if char == 'a' and a+b < A+B:
        print("Yes")
        a += 1
    elif char == 'b' and a+b < A+B and b < B:
        print("Yes")
        b += 1
    else:
        print("No")

Solution (Python):
n, a, b = map(int, input().split())
st = input()
c = a + b
for s in st:
    if s == "a":
        if c >= 1:
            c -= 1
            print("Yes")
        else:
            print("No")
    elif s == "b":
        if c >= 1 and b >= 1:
            c -= 1
            b -= 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):


n, a, b = map(int,input().split())
s = input()

capacity = 0
foreigner = 0
for i in range(n):
    if s[i] == 'a':
        if capacity <= a+b-1:
            print('Yes')
            capacity += 1
        else:
            print('No')
    elif s[i] == 'b':
        if capacity <= a+b-1 and foreigner <= b-1:
            print('Yes')
            capacity += 1
            foreigner += 1
        else:
            print('No')
            foreigner += 1
    else:
        print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()

import sys

T = A + B
Ta = B

for p in S:
  if p == "c":
    print("No")
    continue
    
  elif p == "a":
    if T > 0:
      print("Yes")
      T -= 1
    else:
      print("No")
      
  else:
    if T > 0 and Ta > 0:
      print("Yes")
      Ta -= 1
      T -= 1
    else:
      print("No")

Solution (Python):




n, a, b = map(int,input().split())
s = list(input())
x = 0 
y = 0 

for c in s:
    if c == "a": 
        if x < a+b:
            x += 1
            print("Yes")
        else:
            print("No")
    if c == "b":
        if x < a+b and y < b:
            x += 1
            y += 1
            print("Yes")
        else:
            print("No")
    if c == "c":
        print("No")

Solution (Python):
N,A,B=map(int,input().split())
S=input()

passer=0
passb=0
for p in S:
    if p =="c":
        print("No")
    if p=="a":
        if passer < A+B:
            print("Yes")
            passer+=1
        else:
            print("No")
    if p=="b":
        if passer <A+B and passb <B:
            print("Yes")
            passer+=1
            passb+=1
        else:
            print("No")

Solution (Python):
n, a, b = map(int, input().split())
s = input()
cnt = 0
b_cnt = 0
for c in s:
    if c == 'b':
        b_cnt += 1
        if b_cnt <= b and cnt < a+b:
            cnt += 1
            print('Yes')
        else:
            print('No')
    elif c == 'a':
        if cnt < a+b:
            cnt += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Solution (Python):
def main():
    n, A, B = list(map(int, input().split()))
    S = input()
    a, b = 0, 0
    for s in S:
        if s == 'a':
            if a + b < A + B:
                print('Yes')
                a += 1
            else:
                print('No')
        elif s =='b':
            if a + b < A + B and b < B:
                print('Yes')
                b += 1
            else:
                print('No')
        else:
            print('No')

if __name__ == '__main__':
    main()

Solution (Python):

n,a,b = map(int, input().split())
s = list(input()) 

pass_contest = 0

rank_overseas = 0
for i in range(len(s)):
    if s[i] == "c":
        print("No")
    elif s[i] == "a" and pass_contest < a+b:
        print("Yes")
        pass_contest += 1
    elif s[i] == "b":
        rank_overseas += 1
        if pass_contest < a+b and rank_overseas <= b:
            print("Yes")
            pass_contest += 1
        else:
            print("No")
    else:
        print("No")

Solution (Python):
N,A,B=map(int,input().split())
S=input()

nowA=0
nowB=0

for s in S:
    if s=='c':
        print('No')
    elif s=='a':
        if nowA+nowB<A+B:
            print('Yes')
            nowA+=1
        else:
            print('No')
    else:
        if nowA+nowB<A+B and nowB<B:
            print('Yes')
            nowB+=1
        else:
            print('No')

Solution (Python):
n,a,b=map(int,input().split())
s=input()
counta=0
countb=0
for i in range(n):
    if s[i]=="c":
        print("No")
    elif s[i]=="b":
        if counta<a+b and countb<b:
            counta+=1
            countb+=1
            print("Yes")
        else:
            print("No")
    else:
        if counta<a+b:
            counta+=1
            print("Yes")
        else:
            print("No")

Solution (Python):
n, a, b = map(int, input().split())
l = input()
num_d = num_i = 0
for i in range(n):
    if l[i] == 'c':
        print('No')
    elif l[i] == 'a':
        if num_d+num_i < a+b:
            print('Yes')
            num_d += 1
        else:
            print('No')
    else:
        if num_d+num_i < a+b:
            if num_i < b:
                print('Yes')
                num_i += 1
            else:
                print('No')
        else:
            print('No')

Solution (Python):
n,a,b = map(int,input().split())
li = list(input())
c=a+b
for stu in li:
  if stu=='a':
    if c==0:
      print("No")
    else:
      c-=1
      print("Yes")
  elif stu=='b':
    if b==0 or c==0:
      print("No")
    else:
      c-=1
      b-=1
      print("Yes")
  else:
    print("No")

Solution (Python):
n , a, b = map(int, input().split())
s = input()
t = 0
count = 1
ans = []
for i in range(n):
    if s[i] == 'a' and count <= (a+b):
        ans.append('Yes')
        count += 1
    elif s[i] == 'b':
        t += 1
        if count <= (a+b) and  t <= b:
            ans.append('Yes')
            count += 1
        else:
            ans.append('No')
    else:
        ans.append('No')
for i in ans:
    print(i)

Solution (Python):
N, A, B = map(int, input().split())
S = list(input())
cnt = 0
b_cnt = 0

for i in range(N):
    if S[i] == 'a':
        S[i] = 'Yes'
        cnt += 1
    elif S[i] == 'b':
        if b_cnt >= B:
            continue
        S[i] = 'Yes'
        cnt += 1
        b_cnt += 1

    if cnt == A + B:
        break

ans = ['No' if j != 'Yes' else j for j in S]

for k in range(N):
    print(ans[k])

Solution (Python):
def resolve():
    N, A, B = list(map(int, input().split()))
    S = str(input())
    num = 0
    foreignnum = 1
    for i in range(N):
        if S[i] == 'a':
            if (num < A + B):
                num += 1
                print('Yes')
            else:
                print('No')

        if S[i] == 'b':
            if (num < A + B) and (foreignnum <= B):
                num += 1
                foreignnum += 1
                print('Yes')
            else:
                print('No')

        if S[i] == 'c':
            print('No')
    return
resolve()

Solution (Python):
n, a, b = map(int, input().split())
st = str(input())
bor = a + b

ans = []

pa = 1
fore = 1

for i in st:
    if i == 'a':
        if pa <= bor:
            print('Yes')
            pa += 1
        else:
            print('No')
    elif i == 'b':
        if pa <= bor:
            if fore <= b:
                print('Yes')
                pa += 1
                fore +=1
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')

Solution (Python):
n, a, b = map(int, input().split())
s = input()

i = 0
j = 0
for n in s:
  if n == "a":
    if i + j < a + b:
      i += 1
      print("Yes")
    else:
      print("No")
  elif n == "b":
    if (i + j < a + b) and j < b:
      j += 1
      print("Yes")
    else:
      print("No")
  else:
    print("No")

Solution (Python):
N, A, B = map(int,input().split(" "))
S = input()
count = {"a":0,"b":0}
for s in S:
    if s == "a" and count["a"] + count["b"] < A+B:
        count["a"] += 1
        print("Yes")
    elif s == "b" and count["a"] + count["b"] < A+B and count["b"]<B:
        count["b"]+=1
        print("Yes")
    else:
        print("No")

Solution (Python):
N, A, B = map(int, input().split())
S = list(input())

answer = 0
b_list = 0
for idx, moji in enumerate(S):
    if moji == "a" and answer < A + B:
        answer += 1
        print("Yes")
        continue
    elif moji == "b":
        b_list += 1
        if answer < A + B and b_list <= B:
            answer += 1
            print("Yes")
            continue
    print("No")

Solution (Python):
N, A, B = map(int, input().split())
S = list(input())

answer = 0
b_list = 0
for idx, moji in enumerate(S):
    if moji == "a" and answer < A + B:
        answer += 1
        print("Yes")
        continue
    elif moji == "b":
        b_list += 1
        if answer < A + B and b_list <= B:
            answer += 1
            print("Yes")
            continue
    print("No")

Solution (Python):
n, a, b = map(int, input().split())
S = list(input())

t_pass = 0
f_pass = 1

for e in S:
    if e == 'a':
        if t_pass < a + b:
            t_pass += 1
            print('Yes')
        else:
            print('No')
    elif e == 'b':
        if t_pass < a + b and f_pass <= b:
            t_pass += 1
            f_pass += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Solution (Python):
N,A,B = map(int, input().split())
S = list(input())
cnt_all = 0
cnt_over = 0
for i in range(N):
    if S[i] == 'a':
        if cnt_all < A+B:
            print("Yes")
            cnt_all += 1
        else:
            print("No")
    elif S[i] == 'b':
        if cnt_all < A+B and cnt_over < B:
            print("Yes")
            cnt_all += 1
            cnt_over += 1
        else:
            print("No")
    else:
        print("No")

Solution (Python):
n,a,b=map(int,input().split())
s=str(input())
s=list(s)
for i in range(len(s)):
  if s[i]=="a" and a+b>0:
    print("Yes")
    if a>0:
      a=a-1
    else:
      b=b-1
  elif s[i]=="b" and b>0:
    print("Yes")
    b=b-1
  else:
    print("No")

Solution (Python):
n, a, b = map(int, input().split())
S = input()
cnt = 0
cnt2 = 0
for s in S:
    if s == 'a' and cnt < (a + b):
        print('Yes')
        cnt += 1
    elif s == 'b' and cnt < (a + b)and cnt2 < b:
        print('Yes')
        cnt += 1
        cnt2 += 1
    else:
        print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()

for c in S:
    if c == 'b':

        B -= 1
        if B >= 0 and (A+B) >= 0:
            print("Yes")
        else:
            print("No")
    elif c == 'a':
        A -= 1
        if (A+max(0, B)) >= 0:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Solution (Python):
N,A,B=map(int,input().split())
S=input()
count=0
out=1
for s in S:
    if s=="a" and count<A+B:
        count+=1
        print("Yes")
    elif s=="b" and count<A+B and out<=B:
        count+=1
        out+=1
        print("Yes")
    else:
        print("No")

Solution (Python):
N, A, B = [int(x) for x in input().split(" ")]
s = input()
num_passed = 0
num_passed_f = 0
for index, s in enumerate(s):
    if s == "a":
        if num_passed < A + B:
            print("Yes")
            num_passed += 1
            continue
    if s == "b":
        if num_passed < A + B and num_passed_f < B:
            print("Yes")
            num_passed += 1
            num_passed_f += 1
            continue
    print("No")

Solution (Python):
N, A, B = list(map(int,input().split()))
S = input()
p = fp = 0
for s in S:
    if s=="a" and p<A+B:
        print("Yes")
        p += 1
    elif s=="b" and p<A+B and fp<B:
        print("Yes")
        p += 1
        fp += 1
    else:
        print("No")

Solution (Python):
n,a,b =map(int, input().split())
s =input()
ca = 0
cb = 0
for i in s:
    if i=='a' and ca+cb<a+b:
        ca+=1
        print('Yes')
    elif i=='b' and ca+cb<a+b and cb<b:
        cb+=1
        print('Yes')
    else:
        print('No')

Solution (Python):
n, a, b = map(int, input().split())
s = input()
overseas = 0
student = 0
for i in range(n):
    if s[i] == "a":
        if a + b > student:
            print("Yes")
            student += 1
        else:
            print("No")
    if s[i] == "b":
        if a + b > student and overseas < b:
            print("Yes")
            overseas += 1
            student += 1
        else:
            print("No")
    if s[i] == "c":
        print("No")

Solution (Python):
n, a, b = map(int,input().split())
s = list(str(input()))
a_Yes = 0
b_Yes = 0

for i in range(n):
    if s[i] == "a":
        if  a_Yes + b_Yes <a+b:
            print("Yes")
            a_Yes += 1
        else:
            print("No")

    elif s[i] == "b" :
        if b_Yes < b and  a_Yes + b_Yes <a+b:
            print("Yes")
            b_Yes += 1
        else:
            print("No")

    else:
        print("No")

Solution (Python):
N,A,B = list(map(int,input().split()))
S = list(input())
listB = []
cnt = 0
for s in S:
    if s == 'a':
        if cnt < A+B:
            print('Yes')
            cnt += 1
        else:
            print('No')
    elif s == 'b':
        if cnt < A+B and len(listB)+1 <= B:
            print('Yes')
            cnt += 1
            listB.append('b')
        else:
            print('No')
    else:
        print('No')

Solution (Python):
n, a, b = map(int, input().split())
s = input()

all = list(s)
count = 0
count_b = 0
for i in all:
    if i == 'a':
        if count < a + b:
            print('Yes')
            count += 1
        else:
            print('No')
    elif i == 'b':
        if (count < a + b) and (count_b < b):
            print('Yes')
            count += 1
            count_b += 1
        else:
            print('No')
    else:
        print('No')

Solution (Python):
n, a, b = map(int, input().split())
s = input()

all = list(s)
count = 0
count_b = 0
for i in all:
    if i == 'a':
        if count < a + b:
            print('Yes')
            count += 1
        else:
            print('No')
    elif i == 'b':
        if (count < a + b) and (count_b < b):
            print('Yes')
            count += 1
            count_b += 1
        else:
            print('No')
    else:
        print('No')

Solution (Python):
N,A,B=map(int,input().split())
S=input()
a=b=0
for s in S:
    if s=="a" and a+b<A+B:
        a+=1
        print("Yes")
    elif s=="b" and a+b<A+B and b<B:
        b+=1
        print("Yes")
    else:
        print("No")

Solution (Python):
from sys import stdin
N, A, B = [int(_) for _ in stdin.readline().rstrip().split()]
S = stdin.readline().rstrip()
limit = A + B
ab_count, b_count = 0, 0
for c in S:
    if c == 'a':
        if ab_count < limit:
            print('Yes')
            ab_count += 1
        else:
            print('No')
    elif c == 'b':
        if ab_count < limit and b_count < B:
            print('Yes')
            ab_count += 1
            b_count += 1
        else:
            print('No')
    else:
        print('No')

Solution (Python):
n,a,b = map(int,input().split())
s = input()
al = [-1]*n
for i in range(n):
  if s[i] == 'a':
    if a+b > 0:
      a -= 1
      al[i] = 1
    else:
      al[i] = 0
  elif s[i] == 'b':
    if b > 0 and a+b > 0:
      b -= 1
      al[i] = 1
    else:
      al[i] = 0
  else:
    al[i] = 0
for t in al:
  if t == 1:
    print('Yes')
  else:
    print('No')

Solution (Python):
N, A, B = input().split(' ')
N = int(N)
A = int(A)
B = int(B)
S = []
S = list(input())
JS = 0
AS = 0
OT = 0

for i in range(N):
  if S[i] == 'a' and A+B > JS+AS:
    print('Yes')
    JS += 1
  elif S[i] == 'b' and A+B > JS+AS and AS < B:
    print('Yes')
    AS += 1
  else:
    print('No')

Solution (Python):
n, a, b = map(int, input().split())
s = input()
s = [str(c) for c in s]
pas = 0
f = 0

for i, v in enumerate(s):
    if pas < a + b and v == "a":
        pas += 1
        print("Yes")
    elif pas < a + b and f < b and v == "b":
        pas += 1
        f += 1
        print("Yes")
    else:
        print("No")

Solution (Python):
n, a, b = map(int, input().split())
s_l = input()
ca = 0
cb = 0
for s in s_l:
    if s == 'a' and ca + cb < a+b:
        ca += 1
        print('Yes')
    elif s == 'b' and ca + cb < a+b and cb < b:
        cb += 1
        print('Yes')
    else:
        print('No')

Solution (Python):
n, a, b = map(int, input().split())
s_l  = input()
ca = 0
cb = 0
for s in s_l:
  if s == 'a' and ca + cb < a+b:
    ca += 1
    print('Yes')
  elif s == 'b' and ca + cb < a+b and cb < b:
    cb += 1
    print('Yes')
  else:
    print('No')

Solution (Python):
N, A, B = map(int,input().split())
X = input()
S = A+B

cnt1 = 0
cnt2 = 0

for i in range(len(X)):
	if X[i] == "c":
		print("No")

	elif X[i] == "a":
		if cnt1 < S:
			print("Yes")
			cnt1 += 1
		else: print("No")
	else:
		if cnt1 < S and cnt2 < B:
			print("Yes")
			cnt1 += 1
			cnt2 += 1
		else: print("No")

Solution (Python):
N, A, B = map(int, input().split())
S = input()

for i in range(len(S)):
    if S[i] == "c":
        print("No")
    if S[i] == "a":
        if A > 0:
            print("Yes")
            A = A-1
        elif B > 0:
            print("Yes")
            B = B-1
        else :
            print("No")
    if S[i] == "b":
        if B > 0:
            print("Yes")
            B = B-1
        else :
            print("No")

Solution (Python):
N,A,B = map(int,input().split())
S = input()

passed = 0 
fo = 1 
for i in range(N):
  if(S[i] == 'a'):
    if(passed < A+B):
      print('Yes')
      passed += 1
    else:
      print('No')
  elif(S[i] == 'b'):
    if((passed < A+B)and(fo <= B)):
      print('Yes')
      fo += 1
      passed += 1
    else:
      print('No')
  elif(S[i] == 'c'):
     print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()

su = A+B
a = 0
b = 0


for i in range(N):
    f = 0
    if S[i] == "a":
        if su > a + b:
            f = 1
            a += 1
    elif S[i] == "b":
        if su > a+b and B > b:
            f = 1
            b += 1
    if f:
        print("Yes")
    else:
        print("No")

Solution (Python):
n, a, b = map(int, input().split())
s = input()
q = [1] * n
for i,l in enumerate(s):
    q[i] *= ((l == "b" and b > 0) or l == "a") and a + b > 0
    b -= q[i]*(l == "b")
    a -= q[i]*(l == "a")
print("\n".join(["YNeos"[1-i::2] for i in q]))

Solution (Python):
n,a,b = map(int, input().split())
s = input()
ap=0
bp=0
for i in range(n):
    if s[i]=='a' and ap+bp<a+b:
        ap+=1
        print('Yes')
    elif s[i]=='b' and ap+bp<a+b and bp<b:
        bp+=1
        print('Yes')
    else:
        print('No')

Solution (Python):
n,a,b = map(int, input().split())
s = input()
ap=0
bp=0
for i in range(n):
    if s[i]=='a' and ap+bp<a+b:
        ap+=1
        print('Yes')
    elif s[i]=='b' and ap+bp<a+b and bp<b:
        bp+=1
        print('Yes')
    else:
        print('No')

Solution (Python):
N, A, B = list(map(int, input().split()))
S = input()
y, yab = 0, 1

for s in S:
    if(s == 'a'):
        if(y < A + B):
            print("Yes")
            y += 1
        else:
            print("No")
    elif(s == 'b'):
        if(y < A + B and yab <= B):
            print("Yes")
            y += 1
            yab += 1
        else:
            print("No")
    else:
        print("No")

Solution (Python):
n,a,b = map(int,input().split())
S = input()
now = 0
kai = 0
for s in S:
    if s == "a" and now < (a+b):
        print("Yes")
        now += 1
    elif s == "b" and now < (a+b) and kai < b:
        print("Yes")
        now += 1
        kai += 1
    else:
        print("No")

Solution (Python):
N, A, B = list(map(int, input().split()))
S = input()
passed_all = 0
passed_foreign = 0

for s in S:
    if s == 'a':
        if passed_all < A + B:
            passed_all += 1
            print('Yes')
        else:
            print('No')
    elif s == 'b':
        if passed_all < A + B and passed_foreign < B:
            passed_all += 1
            passed_foreign += 1
            print('Yes')
        else:
            print('No')
    elif s == 'c':
        print('No')

Solution (Python):
n,a,b = map(int, input().split())
s = input()
count = 0
count_b = 0
for i in range(len(s)):
    if s[i]=="a":
        if(count < a+b):
            print("Yes")
            count += 1
        else:
            print("No")
    elif s[i]=="b":
        count_b += 1
        if count < a+b and count_b <= b:
            print("Yes")
            count += 1
        else:
            print("No")
    else:
        print("No")

Solution (Python):






N,A,B = map(int, input().split())
S = input()





ab = A+B
ab_count = 0
b_count = 0
for s in list(S):

    if s == "a":
        if ab_count < ab:
            print("Yes")
            ab_count += 1
        else:
            print("No")
    elif s == "b":
        if ab_count < ab and b_count < B:
            print("Yes")
            ab_count += 1
            b_count += 1
        else:
            print("No")
    else:
        print("No")

Solution (Python):
N,A,B = map(int,input().split())
S = input()

cnt = 0 
rank_f = 1 
for i in range(N):
  if(S[i] == 'a'):
    if(cnt < A+B):
      print('Yes')
      cnt += 1
    else:
      print('No')
  elif(S[i] == 'b'):
    if((cnt < A+B)and(rank_f <= B)):
      print('Yes')
      rank_f += 1
      cnt += 1
    else:
      print('No')
  elif(S[i] == 'c'):
     print('No')

Solution (Python):
N,A,B = map(int,input().split())
S = input()

passn = 0
passab = 0

for s in S:
    if s == 'c':
        print('No')
        continue
    elif s == 'a':
        if passn < A+B:
            passn += 1
            print('Yes')
        else:
            print('No')
    else:
        if passn < A+B and passab < B:
            passn += 1
            passab += 1
            print('Yes')
        else:  
            print('No')

Solution (Python):
n, a, b = map(int, input().split())
total = a + b
s = list(input())
for c in s:
	if c == 'a' :
		if total > 0 :
			print("Yes")
			total -= 1
		else :
			print("No")
	elif c == 'b' :
		if b > 0 and total > 0 :
			print("Yes")
			total -= 1
			b -= 1
		else :
			print("No")
	else :
		print("No")

Solution (Python):
def li():
    return list(map(int, input().split()))


def mi():
    return map(int, input().split())


def ii():
    return int(input())


N, A, B = mi()

S = input()
oversea = 0
passes = 0

for i in range(len(S)):
    if S[i] == "a":
        if passes < (A + B):
            print("Yes")
            passes += 1
        else:
            print("No")
    elif S[i] == "b":
        oversea += 1
        if passes < (A + B) and oversea <= B:
            print("Yes")
            passes += 1
        else:
            print("No")
    else:
        print("No")

Solution (Python):
n,a,b = [int(x) for x in input().split()]
s = input()
count = 0
b_count = 0
for st in s:
    if (st == 'a') & (count < (a+b)):
        count += 1
        print('Yes')
    elif (st == 'b') & (count < (a+b)) &(b_count < b):
        count += 1
        b_count += 1
        print('Yes')
    else:
        print('No')

Solution (Python):
N, A, B = map(int, input().split())
S = input()

pass_user_num = 0
f_pass_user_num = 0

for index, user in enumerate(S):
    if user == 'a' and pass_user_num < (A+B):
        print('Yes')
        pass_user_num += 1
    elif user == 'b' and pass_user_num < (A+B) and f_pass_user_num < B:
        print('Yes')
        pass_user_num += 1
        f_pass_user_num += 1
    else:
        print('No')

Solution (Python):


import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, A, B = map(int, readline().split())
S = readline().decode().rstrip()

cnt_A = 0
cnt_B = 0

for c in S:
    if c == 'c':
        print("No")

    elif c == 'a':
        if cnt_A + cnt_B < A + B:
            print("Yes")
            cnt_A += 1
        else:
            print("No")
    else:
        if (cnt_A + cnt_B < A + B) and (cnt_B + 1 <= B):
            print("Yes")
            cnt_B += 1

        else:
            print("No")

Solution (Python):
N,A,B=map(int,input().split())
S = input()

count = 0
abroadCount = 0

for c in S:
    result = False
    if c == "a":
        if count<A+B:
            result = True
            count+=1
    if c=="b":
        if count<A+B and abroadCount < B:
            result = True
            count+=1
            abroadCount +=1
    if result: print('Yes')
    else: print('No')

Solution (Python):
def resolve():
    N, A, B = map(int, input().split())
    S = input()
    Atmp = 0
    Btmp = 0
    ans = []
    my_append = ans.append
    for i in S:
        if i == 'a':
            if Atmp + Btmp < A+B:
                Atmp += 1
                my_append('Yes')
            else:
                my_append('No')
        elif i == 'b':
            if Btmp < B and Atmp + Btmp < A+B:
                Btmp += 1
                my_append('Yes')
            else:
                my_append('No')
        else:
            my_append('No')
    print("\n".join(ans))
resolve()

Solution (Python):
def resolve():
    N, A, B = map(int, input().split())
    S = input()
    Atmp = 0
    Btmp = 0
    for i in S:
        if i == 'a':
            if Atmp + Btmp < A+B:
                Atmp += 1
                print('Yes')
            else:
                print('No')
        elif i == 'b':
            if Btmp < B and Atmp + Btmp < A+B:
                Btmp += 1
                print('Yes')
            else:
                print('No')
        else:
            print('No')
resolve()