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())
S = list(input())

n = 0
b = 0

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

Solution (Python):
"""
    参加: N 人
    

    input:
        - S: S[i] == 'a' -> 国内, b -> 海外, c -> Neither
    output: 予選通過/No Yes/No
"""

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

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

Solution (Python):
"""
    参加: N 人
    

    input:
        - S: S[i] == 'a' -> 国内, b -> 海外, c -> Neither
    output: 予選通過/No Yes/No
"""

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

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

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

Solution (Python):
N, A, B = map(int, input().split())
S = input()
passed = 0
passed_foreign = 0
ans = [False for _ in range(N)]

for i, human in enumerate(S):
    if human == 'a' and passed < A+B:
        passed += 1
        ans[i] = True
    if human == 'b' and passed < A+B and passed_foreign < B:
        passed += 1
        passed_foreign += 1
        ans[i] = True

for a in ans:
    print('Yes' if a else 'No')

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))




def resolve():
    N,A,B=pin()
    S=input()
    a=0
    b=0
    for s in S:
        
        if s=="c":
            print("No")
            continue
        elif s=="a":
            a+=1
        else:
            
            if b>=B:
                print("No")
                continue
            b+=1
        
        if (a+b)<=(A+B):
            print("Yes")
        else:print("No")
    


resolve()

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

for i in s:
    if i == 'a':
        if domestic + abroad <= a + b - 1:
            print('Yes')
            domestic += 1
        else:
            print('No')
    elif i == 'b':
        if domestic + abroad <= a + b - 1 and abroad <= b - 1:
            print('Yes')
            abroad += 1
        else:
            print('No')
    else:
        print('No')

Solution (Python):
import sys
input = sys.stdin.readline

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

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

Solution (Python):
import sys


def main():
    n, a, b = map(int, sys.stdin.readline().split())
    s = sys.stdin.readline().rstrip()

    ans = ["No"] * n
    success = 0
    foreigner = 0

    for i in range(n):
        if s[i] == "a":
            ans[i] = "Yes"
            success += 1
        elif s[i] == "b" and foreigner < b:
            ans[i] = "Yes"
            success += 1
            foreigner += 1
        if success == a + b:
            break

    print("\n".join(ans))
    return


if __name__ == "__main__":
    main()

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

ans = ["No"] * n
success = 0
foreigner = 0

for i in range(n):
    if s[i] == "a":
        ans[i] = "Yes"
        success += 1
    elif s[i] == "b" and foreigner < b:
        ans[i] = "Yes"
        success += 1
        foreigner += 1
    if success == a + b:
        break

print("\n".join(ans))

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

ans = ["No"] * n
success = 0
foreigner = 0

for i in range(n):
    if s[i] == "a":
        ans[i] = "Yes"
        success += 1
    elif s[i] == "b" and foreigner < b:
        ans[i] = "Yes"
        success += 1
        foreigner += 1
    if success == a + b:
        break

for i in ans:
    print(i)

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

success = 0
foreigner = 0
count = 0

for i in s:
    if i == "a":
        print("Yes")
        success += 1
    elif i == "b" and foreigner < b:
        print("Yes")
        success += 1
        foreigner += 1
    else:
        print("No")
    count += 1
    if success == a + b:
        break

for _ in range(n - count):
    print("No")

Solution (Python):
N,A,B = list(map(int,input().split()))
listA = list(input())
human = 0
foreign = 0
for i in listA:
    if i == "a":
        if A+B > human:
            human += 1
            print("Yes")
        else:
            print("No")
    elif i == "b":
        if A+B > human and B > foreign:
            human += 1
            foreign += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

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

for i in list(S):
    if i == "a" and an+bn<A+B :
        print("Yes")
        an+=1
    elif i == "b" and an+bn<A+B and bn<B:
        print("Yes")
        bn+=1
    else:
        print("No")

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

sum = a + b
passingD = 0  
passingF = 0  
flag = 'No'

for i, student in enumerate(s, 1):
    if student == 'a' and (passingD + passingF) < sum:
        passingD = passingD + 1
        flag = 'Yes'
    elif student == 'b' and (passingD + passingF) < sum and passingF < b:
        passingF = passingF + 1
        flag = 'Yes'
    else:
        flag = 'No'

    print(flag)

Solution (Python):
n,a,b=map(int,input().split())
s=input()
ans=list('No'for _ in range(n))
c=a+b
countY=0
countb=0
for i in range(n):
    if countY<c:
        if s[i]=='a':
            ans[i]='Yes'
            countY+=1
        if s[i]=='b' and countb<b:
            ans[i]='Yes'
            countY+=1
            countb+=1
            
print(*ans,sep='\n')

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

d = 0
o = 0
p = 0

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

Solution (Python):

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

S = input()
for s in S:
    if s == 'c':
        print('No')
    elif cnt >= A+B:
        print('No')
    elif s == 'b' and b_cnt >= B:
        print('No')
    else:
        cnt += 1
        if s == 'b':
            b_cnt += 1
        print('Yes')

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

PassNo = 0
Limit = A + B
StuJpn = 0
StuInt = 0

for i in S:
  if PassNo < Limit:
    if i == 'a':
      StuJpn += 1
      print("Yes")
    elif i == 'b':
      if StuInt < B:
        StuInt += 1
        print("Yes")
      else:
        print("No")
    else:
      print("No")
  else:
    print("No")
  PassNo = StuJpn + StuInt

Solution (Python):
N, A, B = map(int, input().split())
S = list(input())
cntA = 0; cntB = 0
for s in S:
    if s == 'a' and cntA+cntB < A+B:
        print('Yes')
        cntA += 1
    elif s == '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()
ab = a + b
cnt = 0
cnt_b = 0
for i in range(n):
    p = s[i]
    if p == 'a':
        if cnt < ab:
            print('Yes')
            cnt += 1
        else:
            print('No')
    elif p == 'b':
        if cnt < ab and cnt_b < b:
            print('Yes')
            cnt += 1
            cnt_b += 1
        else:
            print('No')
    else:
        print('No')

Solution (Python):
import sys

input = sys.stdin.readline

def main():
    a = 'a'
    b = 'b'
    c = 'c'
    y = 'Yes'
    n = 'No'
    ac = 0
    bc = 0
    N, A, B = map(int, input().split())
    s = input()
    for i in range(N):
        if s[i] == a:
            if ac < A + B:
                print(y)
                ac += 1
            else:
                print(n)
        elif s[i] == b:
            if ac < A + B and bc+1 <= B:
                print(y)
                ac += 1
                bc += 1
            else:
                print(n)
        else:
            print(n)

if __name__ == '__main__':
    main()

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

countA = 0
countB = 0

for i in S:
  if i == 'a' and countA + countB < A + B:
      print("Yes")
      countA += 1
  
  elif i == 'b' and countA + countB < A + B and countB < B:
      print("Yes")
      countB += 1
    
  else:
    print("No")

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







passes_num = 0  
foregin_rank = 1  
thredshould = a + b
for c in s:
    if c == "c":
        print("No")
    elif c == "a":
        if passes_num < thredshould:
            passes_num += 1
            print("Yes")
        else:
            print("No")
    else:
        if passes_num < thredshould and foregin_rank <= b:
            passes_num += 1
            foregin_rank += 1
            print("Yes")
        else:
            print("No")

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

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

s = list(input())

t = 0

kt = 0

j = 1

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

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

accept = 0
accept_ab = 0
for i in s:
    if i == "a":
        if accept<a+b:
            accept+=1
            print("Yes")
        else:
            print("No")
    if i == "b":
        if accept<a+b and accept_ab <b:
            accept+=1
            accept_ab+=1
            print("Yes")
        else:
            print("No")
    if i =="c":
        print("No")

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

sum_AB = a + b
sum_total = 0
sum_B = 0

for s in s_list:
    if s == 'c':
        print('No')
        continue
    if s == 'a':
        if sum_total < sum_AB:
            print("Yes")
            sum_total += 1
        else:
            print('No')
    elif s == 'b':
        if sum_total < sum_AB and sum_B < b:
            print('Yes')
            sum_total += 1
            sum_B += 1
        else:
            print('No')

Solution (Python):
N, A, B = map(int, input().split()) 
s = [i for i in input()]
count = 0
sb = 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':
            if (count < (A+B)) and (sb < B):
                  print('Yes')
                  count += 1
                  sb += 1
            else:
                  print('No')
      
      elif s[i] == 'c':
            print('No')

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

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

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

str = input()

res = a + b
b_num = 1

for i in range(len(str)):
    if(str[i] == 'a'):
        if(res > 0):
            print('Yes')
            res -= 1
        else:
            print('No')
    elif(str[i] == 'b'):
        if(res > 0) and (b_num <= b):
            print('Yes')
            res -= 1
            b_num += 1
        else:
            print('No')
    else:
        print('No')

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

    total, _b, = 0, 0
    for t in s:
        if t == 'a':
            if total < (a + b):
                print('Yes')
                total += 1
            else:
                print('No')

        elif t == 'b':
            if total < (a + b) and _b < b:
                print('Yes')
                _b += 1
                total += 1
            else:
                print('No')
        else:
            print('No')

resolve()

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

    total, _b, = 0, 0
    for t in s:
        if t == 'a':
            if total < (a + b):
                print('Yes')
                total += 1
            else:
                print('No')

        elif t == 'b':
            if total < (a + b) and _b < b:
                print('Yes')
                _b += 1
                total += 1
            else:
                print('No')
        else:
            print('No')

resolve()

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

a_cnt = b_cnt = 0

for s in S:
  if s == "c":
    print("No")
  elif s == "a":
    if a_cnt+b_cnt < A+B:
      a_cnt += 1
      print("Yes")
    else:
      print("No")
  else:
    if a_cnt+b_cnt < A+B and b_cnt+1 <= B:
      b_cnt += 1
      print("Yes")
    else:
      print("No")

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

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

goal =0
Bgoal =0

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

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


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

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

def solve(S):
    ans = []
    students = 0
    foreigners = 0
    for i in range(N):
        if S[i]=='a' and students<A+B:
            ans.append('Yes')
            students += 1
        elif S[i]=='b' and foreigners<B and students<A+B:
            ans.append('Yes')
            students += 1
            foreigners += 1
        else:
            ans.append('No')
    return ans
print(*solve(S),sep='\n')

Solution (Python):
n, a, b = map(int, input().split())
s = input()
 
for i in s:
    if (i == "a" and a + b > 0):
        print("Yes")
        a -= 1
    elif (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 = [0] + list(input())

num_pass = 0
num_pass_foreign = 0

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

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

for i in s:
    if (i == "a" and A + B > 0):
        print("Yes")
        A -= 1
    elif (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() 

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

Solution (Python):
n, a, b = map(int, input().split())
s = input()
a_cnt = b_cnt = 0
p = True
for si in s:
    if si == "c":
        print("No")
    elif si == "a":
        if p:
            print("Yes")
            a_cnt += 1
        else:
            print("No")
    else:
        if p and b_cnt < b:
            print("Yes")
            b_cnt += 1
        else:
            print("No")
    if p and a_cnt + b_cnt == a + b:
        p = False

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

Solution (Python):
def resolve():
  N, A, B = [int(i) for i in input().split()]
  S = input()
  
  passed_a = 0
  passed_b = 0
  result = [False]*N
  
  for i in range(N):
    if S[i] == "a":
      if passed_a + passed_b < A + B:
        passed_a += 1
        result[i] = True
    
    elif S[i] == "b":
      if passed_a + passed_b < A + B and passed_b < B:
        passed_b += 1
        result[i] = True

  ans = ["Yes" if i else "No" for i in result]
  print("\n".join(ans))

resolve()

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

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

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

passed = 0
foreigners = 0
for s in S:
  if s == "a" and passed < a+b:
    print("Yes")
    passed += 1
  elif s == "b":
    foreigners += 1
    if passed < a+b and foreigners <= b:
      print("Yes")
      passed += 1
    else:
      print("No")
  else:
    print("No")

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

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

Solution (Python):

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

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

Solution (Python):

N, A, B = map(int, input().split())
S = input()
num = 0
fo = 0
for i in range(N):
    if num >= A + B or S[i] == 'c':
        print('No')
    elif S[i] == 'a':
        print('Yes')
        num += 1
    elif S[i] == 'b':
        fo += 1
        if fo <= B:
            print('Yes')
            num += 1
        else:
            print('No')

Solution (Python):
N,A,B = map(int,input().split())
players = list(input())
tuuka = 0
kaigai = 0
for i in players:
    if i == "c":
        print("No")
        continue
    if i == "b" or i == "a":
        if tuuka < A + B:
            if i == "a":
                print("Yes")
                tuuka += 1
                continue
            if i == "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()

ab=0
f=0

for i in S:
  if i=="a":
    if ab < a+b:
      ab = ab+1
      print("Yes")
    else:
      print("No")
  elif i =="b":
    if ab < a+b and f <b:
      ab = ab+1
      f = f+1
      print("Yes")
    else:
      print("No")
  else:
    print("No")

Solution (Python):



def get_result(N, A, B, S):
    result = []
    num_passed = 0
    rank_global = 1
    for x in S:
        if num_passed >= A+B:
            result.append(False)
            continue
        if x == "a":
            result.append(True)
            num_passed += 1
            continue
        if x == "b":
            if rank_global > B:
                result.append(False)
            else:
                result.append(True)
                num_passed += 1
                rank_global += 1
            continue
        else:
            result.append(False)
    return result

def main():
    N, A, B = map(int, input().split())
    S = input()
    result = get_result(N, A, B, S)
    for x in result:
        if x == True: print("Yes")
        elif x == False: print("No")

if __name__ == "__main__":
    try:
        assert get_result(10, 2, 3, "abccabaabb") == [True, True, False, False, True, True, True, False, False, False]
        assert get_result(12, 5, 2, "cabbabaacaba") == [False, True, True, True, True, False, True, True, False, True, False, False]
    except:
        import traceback
        traceback.print_exc()
        exit()
    main()

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

count = 0
foreign = 0
for s_i in s:
  if s_i=='a':
    if count<a+b:
      count+=1
      print("Yes")
    else:
      print("No")
  elif s_i=='b':
    if count<a+b and foreign < b:
      count+=1
      foreign+=1
      print("Yes")
    else:
      print("No")
  else:
    print("No")

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

Solution (Python):
inp=input().split()
N,A,B=[int(n) for n in inp]
S=input()

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

Solution (Python):
n, a, b = [int(i) for i in input().split()]
s = input()
count = 0
count_b = 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 count_b < b:
    count += 1
    count_b += 1
    print('Yes')
  else:
    print('No')

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

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

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

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

ab = 0
f = 0

for t in s:
    if t == "a":
        if ab < A + B:
            print("Yes")
            ab += 1
        else:
            print("No")
    elif t == "b":
        if ab < A + B and f < B:
            print("Yes")
            ab += 1
            f += 1
        else:
            print("No")
    else:
        print("No")

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

rank = 1
b_rank = 0
for n in range(N):
    if S[n] == 'a':
        if rank <= (A+B):
            rank += 1
            print('Yes')
        else:
            print('No')

    if S[n] == 'b':
        b_rank += 1
        if (rank <= (A+B)) and (b_rank <= B):
            rank += 1
            print('Yes')
        else:
            print('No')

    if S[n] == 'c':
        print('No')

Solution (Python):
import numpy as np
import sys 
read = sys.stdin.buffer.read
read = sys.stdin.buffer.readline
read = sys.stdin.buffer.readlines

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

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

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

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

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

Solution (Python):
N,A,B=map(int,input().split())
S=list(input())
tab=0
tb=0
for x in S:
  if x==('a'):
    if tab<A+B:
      print('Yes')
      tab+=1
    else:
      print('No')
  
  if x==('b'):
    if tb<B and tab<A+B:
      print('Yes')
      tab+=1
      tb+=1
    else:
      print('No')
      
  if x==('c'):
    print('No')

Solution (Python):
n,a,b = map(int,input().split())
s = input()
ga = 0
gb = 0
for i in s:
    if i == 'a':
        if ga >= a+b:
            print('No')
        else:
            print('Yes')
            ga += 1
    elif i == 'b':
        if ga >= a+b or gb >= b:
            print('No')
        else:
            print('Yes')
            ga += 1
            gb += 1
    else:
        print('No')