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=map(int,input().split())
t = a+b

s=input()
n=len(s)

for i in range(n):
	if s[i]=="a" and t > 0:
		print("Yes")
		t = t - 1
	elif s[i]=="b" and t > 0 and b > 0:
		print("Yes")
		t = t - 1
		b = b - 1
	else:
		print("No")

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

Solution (Python):
N,A,B=map(int,input().split())
cnta, cntb, cntc = 0,0,0
passed = 0
for i, s in enumerate(input()):
  if s == 'a':
    if passed<A+B:
      print('Yes')
      passed += 1
    else:
      print('No')
    cnta += 1
    
  elif s == 'b':
    if passed<A+B and cntb<B:
      print('Yes')
      passed += 1
    else:
      print('No')
    cntb += 1
    
  else:
    print('No')
    cntc += 1

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

A = 0
B = 0
for i in s:
    if A + B < a + b:
        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 = input().strip()
cntA = 0
cntB = 0
for i in range(N):
    x = S[i]
    if x=="a" and cntA<A+B:
        print("Yes")
        cntA += 1
    elif x=="b" and cntA<A+B and cntB<B:
        print("Yes")
        cntA += 1
        cntB += 1
    else:
        print("No")

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

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

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

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

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

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

for i in s:
    if i=='a':
        if a > 0:
            print('Yes')
            a-=1
        elif b > 0:
            print('Yes')
            b-=1
        else:
            print('No')
    elif i=='b':
        if b > 0:
            print('Yes')
            b-=1
        else:
            print('No')
    else:
        print('No')

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

ans,cnt,rank=[],0,0
for s in S:
  if s=='a':
    if a+b>cnt:
      ans.append('Yes')
      cnt+=1
    else:
      ans.append('No')
  elif s=='b':
    rank+=1
    if a+b>cnt and rank<=b:
      ans.append('Yes')
      cnt+=1
    else:
      ans.append('No')
  else:
    ans.append('No')
print(*ans,sep='\n')

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

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

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

stu = 0
fstu = 0

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

Solution (Python):


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

cnt=0
cnt_b=0
for i in range(n):
    if cnt>=(a+b):
        print('No')
        continue
    else:
        if s[i]=='c' or cnt>a+b:
            print('No')
            continue
        else:
            if s[i]=='b':
                cnt_b+=1
                if cnt_b>b:
                    print('No')
                    continue
                else:
                    print('Yes')
                    cnt+=1
            else:
                print('Yes')
                cnt+=1

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

    total = A + B
    domestic = 0
    overseas = 0

    for i in S:
        if i == 'a':
            if domestic + overseas < total:
                print('Yes')
                domestic += 1
                continue
        elif i == 'b':
            if domestic + overseas < total and overseas < B:
                print('Yes')
                overseas += 1
                continue

        print('No')


if __name__ == '__main__':
    main()

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

total = A + B
domestic = 0
overseas = 0

for i in S:
    if i == 'a':
        if domestic + overseas < total:
            print('Yes')
            domestic += 1
            continue
    elif i == 'b':
        if domestic + overseas < total and overseas < B:
            print('Yes')
            overseas += 1
            continue

    print('No')

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32

YES = "Yes"  
NO = "No"  

def solve(N: int, A: int, B: int, S: str):

    b = [1 if S[i]=='b' else 0 for i in range(N)]
    lb = [0] * (N+1)
    for i in range(N):
        lb[i+1] = lb[i] + b[i]


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

        else:
            print(NO)
        

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = int(next(tokens))  
    B = int(next(tokens))  
    S = next(tokens)  
    solve(N, A, B, S)

if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
input = sys.stdin.readline
N, A, B = map(int, input().split())
S = list(input())[: - 1]
res = ["No"] * N
a = 0
b = 0
for i in range(N):
  if S[i] == "a" and (a + b < A + B):
    a += 1
    res[i] = "Yes"
  elif S[i] == "b" and (a + b < A + B) and (b < B):
    b += 1
    res[i] = "Yes"
for r in res: print(r)

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


P = [0]*N
for i in range(N):
  if S[i] == 'a':
    if A > 0:
      A -= 1
      P[i] = 1
    elif B >0:
      B -= 1
      P[i] = 1
  elif S[i] == 'b' and B > 0:
    B -= 1
    P[i] = 1
for i in range(N):
  print('Yes' if P[i] else 'No')

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

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

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

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

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

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

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

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

ca, cb = 0, 0

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

Solution (Python):
from operator import mul
from functools import reduce
from collections import Counter


















import sys

sys.setrecursionlimit(2000)


def inpl():
    return list(map(int, input().split()))



def cmb(n, r):
    
    if n < r:
        return 0
    r = min(n - r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


def gcd(a, b):
    
    while b > 0:
        a, b = b, a % b

    return a


def lcm(a, b):
    
    return a * b // gcd(a, b)


N, A, B = inpl()
S = input()

a = 0
b = 0
for s in S:
    if s == 'c':
        print('No')
        continue
    elif a + b >= A + B:
        print('No')
        continue

    if s == 'a':
        print('Yes')
        a += 1
    elif s == 'b' and b < B:
        print('Yes')
        b += 1
    else:
        print('No')

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

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

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

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

Solution (Python):


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

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":
        if a+b > cnt:
            print("Yes")
            cnt += 1
        else:
            print("No")
    elif s[i] == "b":
        b_cnt += 1
        if a+b > cnt and b >= b_cnt:
            print("Yes")
            cnt += 1
        else:
            print("No")
    else:
        print("No")

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

acnt = 0
bcnt = 0
for s in S:
  if s == "a":
    if (acnt + bcnt) < (A + B):
      print("Yes")
      acnt += 1
    else:
      print("No")    
  elif s== "b":
    if (acnt + bcnt) < (A + B) and bcnt < B:
      print("Yes")
      bcnt += 1
    else:
      print("No")
  else:
    print("No")

Solution (Python):
N, A, B = map(int, input().split())
S = input()
Ans = []
passed = 0
oversee = 0
for c in S:
    f = False
    if c=="a":
        if passed < A+B:
            passed += 1
            f = True
    elif c=="b":
        if passed < A+B and oversee < B:
            passed += 1
            oversee += 1
            f = True
    Ans.append(f)
print("\n".join(map(lambda x: ["No", "Yes"][x], Ans)))

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

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

s=input()
ans=[]
cnt=a+b
tmp=1
for i in range(len(s)):
    if s[i]=="a":
        if cnt>0:
            ans.append("Yes")
            cnt-=1
        else:
            ans.append("No")
    elif s[i]=="b":
        if cnt>0 and tmp<=b:
            ans.append("Yes")
            tmp+=1
            cnt-=1
        else:
            ans.append("No")
    else:
        ans.append("No")

for i in range(len(s)):
    print(ans[i])

Solution (Python):
import sys
input=sys.stdin.readline
n,a,b=map(int,input().split())
s=input()
ok=0
x=0
ans=[]
for i in range(n):
    ss=s[i]
    if ss=="a" and ok<a+b:
        ok+=1
        ans.append("Yes")
    elif ss=="b" and ok<a+b and x<b:
        ok+=1
        x+=1
        ans.append("Yes")
    else:
        ans.append("No")

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

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

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

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

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


if __name__ == "__main__":
    resolve()

Solution (Python):
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N, A, B = list(map(int, sys.stdin.readline().split()))
S = sys.stdin.readline().rstrip()

cnt = 0
b = 0
for c in S:
    ok = False
    if c == 'a':
        ok = cnt < A + B
    if c == 'b':
        ok = cnt < A + B and b < B
        b += ok
    cnt += ok
    if ok:
        print('Yes')
    else:
        print('No')

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

count_a = 0
count_b = 0

for w in s:
    if w == "a":
        if (count_a + count_b) < (a + b):
            count_a += 1
            print("Yes")
        else:
            print("No")
    elif w == "b":
        if (count_a + count_b) < (a + b) and count_b < b:
            count_b += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

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

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

capacity = 0
f_capacity = 0

for c in s:
    if c == 'a':
        if capacity < a+b:
            capacity += 1
            print('Yes')
        else:
            print('No')
    elif c == 'b':
        if capacity < a+b and f_capacity < b:
            capacity += 1
            f_capacity += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

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

Solution (Python):
n,a,b=map(int,input().split())
c1=c2=0
for i in input():
  if c1+c2>=a+b:
    print("No")
  elif i=="a":
    print("Yes")
    c1+=1
  elif i=="b":
    if c2>=b:
      print("No")
    else:
      print("Yes")
      c2+=1
  else:
    print("No")

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

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

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

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

Solution (Python):

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

c = 0
d = 0

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

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

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

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

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

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

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

a,b=0,0
for i,s in enumerate(S):
  if s=="c":
    print("No")
  elif s=="a":
    if a+b<A+B:
      print("Yes")
      a+=1
    else:
      print("No")
  else:
    if 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()
    cnt = 0
    cnt1 = 0
    for i in range(N):
        if S[i] == "a":
            if cnt < A+B:
                cnt += 1
                print("Yes")
            else:
                print("No")
        elif S[i] == "b":
            if cnt < A+B and cnt1 < B:
                cnt += 1
                cnt1 += 1
                print("Yes")
            else:
                print("No")
        else:
            print("No")

if __name__ == '__main__':
    
    main()

Solution (Python):
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)

from math import factorial
import heapq, bisect
import math
import itertools


import queue
from collections import deque




def main():
    num, a, b = map(int, input().split())
    data = list(input())

    for i in range(num):
        if data[i] == 'a':
            if a > 0:
                a -= 1
                print('Yes')
            elif b > 0:
                b -= 1
                print('Yes')
            else:
                print('No')
        elif data[i] == 'b':
            if b > 0:
                b -= 1
                print('Yes')
            else:
                print('No')
        else:
            print('No')




if __name__ == '__main__':
    main()

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

Solution (Python):
_,A,B=map(int,input().split())
for c in input():
 if(c=="a")&(A+B>0):print("Yes");A-=1
 elif(c=="b")&(A+B>0)&(B>0):print("Yes");B-=1
 else:print("No")

Solution (Python):
_,A,B=map(int,input().split());C=A+B
for c in input():
 if(c=="a")&(C>0):print("Yes");C-=1
 elif(c=="b")&(C>0)&(B>0):print("Yes");C-=1;B-=1
 else:print("No")

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

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

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

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

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

Solution (Python):
def solve(n, a, b, s):
    num_domestic = 0
    num_overseas = 0
    for i in range(n):
        if s[i] == "a":
            if num_domestic + num_overseas < a + b:
                num_domestic += 1
                print("Yes")
            else:
                print("No")
        elif s[i] == "b":
            if (num_domestic + num_overseas < a + b) and (num_overseas < b):
                num_overseas += 1
                print("Yes")
            else:
                print("No")
        else:
            print("No")

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

Solution (Python):
N, A, B = map(int, input().split())
s = input()
a = 0
b = 0
ans = []

for i in range(N):
    if s[i] == 'a':
        if a < A:
            ans.append('Yes')
            a += 1
        elif b < B:
            ans.append('Yes')
            b += 1
        else:
            ans.append('No')
    elif s[i] == 'b':
        if b < B:
            ans.append('Yes')
            b += 1
        else:
            ans.append('No')
    else:
        ans.append('No')

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

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

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

Solution (Python):
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20; INF = float("INF"); ans = 0; tmp = 0; cnt = 0; ansli = []; tmpli = []; candili = []; stillset = set()
eps = 1.0 / 10 ** 10; mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]; ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]; ddn9 = ddn + [(0, 0)]
"""for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""
def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def ws(): return sys.stdin.readline().split()
def i(): return int(sys.stdin.readline())
def s(): return input()
def s_list(): return list(input())
def hi(n): return [i() for _ in range(n)]
def hs(n): return [s() for _ in range(n)]
def mi(n): return [wi() for _ in range(n)]
def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[0]] for _ in range(n)]
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]
def grid(n): return [s_list() for _ in range(n)]


if __name__ == '__main__':
    n, a, b = wi()
    s = s()
    acnt = 0
    bcnt = 0
    for i in range(n):
        if s[i] == "a":
            if acnt + bcnt < a + b:
                print("Yes")
                acnt += 1
            else:
                print("No")
        elif s[i] == "b":
            if acnt + bcnt < a + b:
                if bcnt < b:
                    print("Yes")
                    bcnt += 1
                else:
                    print("No")
            else:
                print("No")
        else:
            print("No")