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):
n, a, b = input().split()
s = input()
n = int(n)
a = int(a)
b = int(b)
passed = 0
ovrank = 0
def isPassed(i, a, b, passed, rank=-1):
    if (i == 0):
        if (a + b > passed):
            return "Yes"
        else:
            return "No"
    else:
        if (a + b > passed and rank<=b):
            return "Yes"
        else:
            return "No"

for i in range(len(s)):
    if (s[i] == "a"):
        tmp = isPassed(0, a, b, passed)
        if (tmp == "Yes"):
            passed += 1
        print(tmp)
    elif (s[i] == "b"):
        ovrank+=1
        tmp = (isPassed(1, a, b, passed, ovrank))
        if (tmp == "Yes"):
            passed += 1
        print(tmp)
    else:
        print("No")

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

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

for e in s:
    ans = "No"

    if e == "a":
        if a + b > 0:
            ans = "Yes"
            a -= 1

    elif e == "b":
        if a + b > 0 and b > 0:
            ans = "Yes"
            b -= 1

    print(ans)

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

for i in range(n):
    if s[i] == "c":
        print("No")
    elif s[i] == "a" and (A + B) < a + b:
        print("Yes")
        A += 1
    elif s[i] == "b" and (A + B) < a + b and B < b:
        print("Yes")
        B += 1
    else:
        print("No")

Solution (Python):
def main():
    n, a, b = map(int, input().split())
    s = input().rstrip()
    ans = [None]*n
    cnt_a, cnt_b = 0, 0
    for i in range(n):
        if s[i] == "a":
            if cnt_a + cnt_b < a + b:
                ans[i] = "Yes"
                cnt_a += 1
            else:
                ans[i] = "No"
        elif s[i] == "b":
            if cnt_a + cnt_b < a + b and cnt_b < b:
                ans[i] = "Yes"
                cnt_b += 1
            else:
                ans[i] = "No"
        else:
            ans[i] = "No"
    for q in ans:
        print(q)

if __name__ == "__main__":
    main()

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

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

Solution (Python):

count = 0 


N,A,B = map(int, input().split()) 
                                  
S = input()                       
for i in S:
  if i == "a":
    if A != 0:
      print("Yes")
      A = A - 1
    elif B != 0:
      print("Yes")
      B = B -1
    else:
      print("No")
  elif i == "b":
    if B != 0:
      print("Yes")
      B = B - 1
    else:
      print("No")
  
  else:
    print("No")

Solution (Python):
N,A,B = map(int,input().split())
S = list(input())
cnt = [0,0]
ans = [False]*N
for i in range(N):
    if (S[i] == "c"):
        continue

    if (S[i] == "a"):
        if (sum(cnt) < A+B):
            cnt[0] += 1
            ans[i] = True
    
    if (S[i] == "b"):
        if (sum(cnt) < A+B):
            if (cnt[1] < B):
                cnt[1] += 1
                ans[i] = True

for i in range(N):
    if (ans[i]):
        print("Yes")
    else:
        print("No")

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,a,b = inpl()
s = input()
kaku = 0
e = 0
for _,t in enumerate(s):
    if t == 'a':
        if kaku < a+b:
            print('Yes')
            kaku += 1
        else: print('No')
    elif t == 'b':
        if kaku < a+b and e < b:
            print('Yes')
            kaku += 1; e+= 1
        else: print('No')
    else:
        print('No')

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

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

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

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

yosen_ok=0
kaigai=0
for i,ss in enumerate(s):
    if yosen_ok<a+b:
        if ss=='a':
            yosen_ok+=1
            print('Yes')
        elif ss=='b':
            kaigai+=1
            if kaigai<=b:
                yosen_ok+=1
                print('Yes')
            else:
                print('No')
        else:
            print('No')
        continue
    else:
        print('No')

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

for i in input():
        if i=="a":
                if allr<=a+b:
                        print("Yes")
                        allr += 1
                else: print("No")
        elif i=="b":
                if allr<=a+b and abrr<=b:
                        print("Yes")
                        allr += 1
                else: print("No")
                abrr += 1
        else: print("No")

Solution (Python):

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

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

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

Solution (Python):

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

for i in range(N):
    if S[i] =="a":
        tmp += 1
    elif S[i] =="b":
        tmp2 += 1
    else:
        pass

    if S[i] =="a" and tmp <= A+B:
        print("Yes")
    elif S[i] =="b" and tmp+1 <= A+B and tmp2 <= B:
        tmp += 1
        print("Yes")
    else:
        print("No")

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

Solution (Python):
n,a,b = map(int,input().split())
s = str(input())
lists_s = list(enumerate(s))
ans = []
cnt = 0
b_rank = 0
for i,c in lists_s:
    if c == "a":
        if cnt >= (a+b):
            ans.append("No")
        elif cnt < (a+b):
            ans.append("Yes")
            cnt += 1
    elif c == "b":
        b_rank += 1
        if cnt < (a+b) and b_rank <= b:
            ans.append("Yes")
            cnt += 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 = input()

ans = []
inout = out = 0
for c in S:
    if c=='a':
        if inout < A+B:
            inout += 1
            ans.append('Yes')
        else:
            ans.append('No')
    elif c=='b':
        if inout < A+B and out < B:
            inout += 1
            out += 1
            ans.append('Yes')
        else:
            ans.append('No')
    else:
        ans.append('No')
print(*ans, sep='\n')

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

Solution (Python):

n,a,b = map(int,input().split())
s = input()
cnt = 0
cnt_foreign = 0
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 cnt_foreign < b:
            print("Yes")
            cnt += 1
            cnt_foreign += 1
        else: print("No")
    else: print("No")

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

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

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

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

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

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

total = 0
tot_b = 0

ans = []

for s in S:
    if s == "a" and total < A + B:
        ans.append("Yes")
        total += 1
    elif s == "b" and total < A + B and tot_b < B:
        ans.append("Yes")
        tot_b += 1
        total += 1
    else:
        ans.append("No")

print(*ans, sep="\n")

Solution (Python):
def main():
    N, A, B = (int(i) for i in input().split())
    S = input()
    cnt = 0
    cnt_ob = 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 cnt_ob < B:
                print("Yes")
                cnt += 1
                cnt_ob += 1
            else:
                print("No")
        else:
            print("No")


if __name__ == '__main__':
    main()

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

a = b = 0

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

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

total = 0
overseas = 0

for si in S:
    if si == 'c':
        print('No')
    elif si == 'a':
        if total < A + B:
            total += 1
            print('Yes')
        else:
            print('No')
    else:
        if total < A + B and overseas + 1 <= B:
            total += 1
            overseas += 1
            print('Yes')
        else:
            print('No')

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

an = 0  
bn = 0  
bn2 = 0

total = 0
overseas = 0

for si in S:
    if si == 'c':
        print('No')
    elif si == 'a':
        if total < A + B:
            total += 1
            print('Yes')
        else:
            print('No')
    else:
        if total < A + B and overseas + 1 <= B:
            total += 1
            overseas += 1
            print('Yes')
        else:
            print('No')

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

an = 0  
bn = 0  
an2 = 0 
bn2 = 0

for si in S:
    if si == 'c':
        print('No')
    elif si == 'a':
        if an2 + bn2 < A + B:
            print('Yes')
            an2 += 1
        else:
            print('No')
        an += 1
    else:
        if an2 + bn2 < A + B and bn + 1 <= B:
            print('Yes')
            bn2 += 1
        else:
            print('No')
        bn += 1

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

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

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

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

asum = 0
bsum = 0
for s in S:
    if s == 'a' and asum+bsum < a+b:
        asum += 1
        print('Yes')
    elif s == 'b' and (asum+bsum < a+b and bsum < b):
        bsum += 1
        print('Yes')
    else:
        print('No')

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

now = 0
overseas = 0

for c in S:
    if c == "a":
        if now < A + B:
            print("Yes")
            now += 1
        else:
            print("No")
    if c == "b":
        overseas += 1
        if now < A + B and overseas <= B:
            print("Yes")
            now += 1
        else:
            print("No")
    if c == "c":
        print("No")

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

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

Solution (Python):
n,a,b=map(int,input().split())
L=list(input())
Ans=["No" for _ in range(n)]
cnt=0
cnt_b=0
for i in range(n):
    if L[i]=="a" and cnt<a+b:
        Ans[i]="Yes"
        cnt+=1
    elif L[i]=="b" and cnt<a+b and cnt_b<b:
        Ans[i]="Yes"
        cnt+=1
        cnt_b+=1
for i in range(n):
    print(Ans[i])

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

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

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

ac=0
fc=0

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

Solution (Python):
def main(n: int, a: int, b: int, s: str):
    _a, _b = 0, 0
    a_b = a + b

    for _s in s:
        if _s == 'c':
            print('No')
            continue

        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')


if __name__ == "__main__":
    n, a, b = map(int, input().split())
    s = input()

    main(n, a, b, s)

Solution (Python):


n, a, b = [int(x) for x in input().split()]
s = input()
c_a = 0
c_f = 1
for e in s:
    if e == 'a':
        if c_a < a + b:
            print("Yes")
            c_a += 1
            continue
    elif e == 'b':
        if c_a < a + b:
            if c_f <= b:
                print("Yes")
                c_a += 1
                c_f += 1
                continue
    print("No")

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,A,B = MI()
    S=ST()
    C=A+B
    for s in S:
        if s=="a":
            if C:
                print("Yes")
                C-=1
            else:
                print("No")
        elif s=="b":
            if C and B:
                print("Yes")
                C-=1
                B-=1
            else:
                print("No")
        else:
            print("No")
if __name__ == '__main__':
    main()

Solution (Python):
N, A, B = map(int, input().split())
S = input()
cnt = 1
cnt_b = 0
for i in range(N):
    if(S[i] == "c"):
        print("No")
    else:
        if(cnt <= A+B):
            if(S[i] == "a"):
                print("Yes")
                cnt += 1
            else:
                cnt_b += 1
                if(cnt_b <= B):
                    print("Yes")
                    cnt += 1
                else:
                    print("No")
        else:
            print("No")

Solution (Python):

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

S = input()

na = 0
nb = 0

for i in S:

    if i == "a" and na+nb < A+B:
        print ("Yes")
        na += 1
    elif i == "b" and na + nb < A+B and nb < B:
        print ("Yes")
        nb += 1
    else:
        print ("No")

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

ans = [False] * N
p = 0
b = 0
for i in range(N):
    if S[i] == 'a':
        if p < A + B:
            ans[i] = True
            p += 1
    elif S[i] == 'b':
        if p < A + B and b < B:
            ans[i] = True
            p += 1
            b += 1

for b in ans:
    print("Yes" if b else "No")

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

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

for i in s :
	if i == "c":
		print("No")
		continue


	if i == "a" and c < (a + b):
		print("Yes")
		c += 1
		continue

	elif i == "b" and c < (a + b) and bc < b:
		print("Yes")
		c += 1
		bc += 1
		continue

	print("No")

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

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

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

naka = 0
soto = 0

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

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

Solution (Python):


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

for i in range(n):
    if s[i] == 'c':
        print('No') 
    elif s[i] == 'a' and (domestic + abroad) < (a+b):
        print('Yes')
        domestic += 1
    elif s[i] == 'b' and (domestic + abroad) < (a+b) and abroad < b:
        print('Yes')
        abroad += 1
    else:
        print('No')

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

for i in range(n):

    if (a>0 or b>0) and s[i]=='a':
        print('Yes')
        if a>0 and b>=0:
            a-=1
        else:
            b-=1

    elif b>0 and s[i]=='b':
        print('Yes')
        b-=1
    else:
        print('No')

Solution (Python):
from sys import stdin

n,a,b = [int(x) for x in stdin.readline().rstrip().split()]
s = stdin.readline().rstrip()
count = 0
kaigai = 0
for i in s:
    if i == "a":
        if count < a+b:
            print("Yes")
            count += 1
        else:
            print("No")
    elif i == "b":
        if count < a+b and kaigai < b:
            print("Yes")
            count += 1
            kaigai += 1
        else:
            print("No")
    else:
        print("No")

Solution (Python):
def examA():
    S = SI(); N = len(S)
    T = "CODEFESTIVAL2016"
    ans = 0
    for i in range(N):
        if S[i]!=T[i]:
            ans +=1
    print(ans)
    return

def examB():
    N, A, B = LI()
    S = SI()
    d = defaultdict(int)
    for s in S:
        if s=="a":
            if d["a"]+d["b"]<A+B:
                print("Yes")
                d[s] += 1
            else:
                print("No")
        elif s=="b":
            if d["a"]+d["b"]<A+B and d["b"]<B:
                print("Yes")
                d[s] += 1
            else:
                print("No")
        else:
            print("No")
    return

def examC():

    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,ALPHABET, _ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 1e-9
alphabet = [chr(ord('a') + i) for i in range(26)]
ALPHABET = [chr(ord('A') + i) for i in range(26)]

if __name__ == '__main__':
    examB()

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

Solution (Python):
def main():
    N,A,B = map(int,input().split())
    S = input()
    now = 0
    others = 0
    ans = []

    for i in S:

        if i == "a":
            if now < A+B:
                ans.append("Yes")
                now +=1
            else:
                ans.append("No")
        elif i=="b":
            others += 1
            if now < A+B and others<=B:
                ans.append("Yes")
                now += 1
            else:
                ans.append("No")
        else:
            ans.append("No")
    for i in ans:
        print(i)        
if __name__ == '__main__':
    main()

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

for i in s:
    if i == "c":
        print("No")
    elif i == "b":
        if a+b > ai+bi and b > bi:
            print("Yes")
            bi += 1
        else:
            print("No")
    else:
        if a+b >ai+bi:
            print("Yes")
            ai += 1
        else:
            print("No")

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

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

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


if __name__ == '__main__':
    main()

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

pss = a + b

cnt_all = 0
cnt_oss = 0

for i in range(n):
    if s[i] == "a":
        if cnt_all < pss:
            print("Yes")
            cnt_all += 1
        else:
            print("No")
    elif s[i] == "b":
        if cnt_all < pss and cnt_oss < b:
            print("Yes")
            cnt_all += 1
            cnt_oss += 1
        else:
            print("No")
    elif s[i] == "c":
        print("No")

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

cap_a,cap_b = 0,0

for i in range(n):
	if s[i] == "a":
		if cap_a+cap_b < ab:
			print("Yes")
			if cap_a < a:
				cap_a += 1
			else:
				cap_b += 1
		else:
			print("No")
	elif s[i] == "b":
		if cap_a+cap_b < ab and cap_b < b:
			print("Yes")
			cap_b += 1
		else:
			print("No")
	else:
		print("No")

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