qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N, A, B = map(int, input().split())
S = str(input())

total = 0
kaigai = 0

for i in range(0, len(S)):
    if L[i] == 'a':
        if total < A+B:
            print('Yes')
            total += 1
        else:
            print('No')
    elif L[i] == 'b':
        if total < A+B & kaigai <B:
            print('Yes')
            total += 1
            kaigai += 1
        else:
            print('No')
    else:
        print('No')


Fixed code:
N, A, B = map(int, input().split())
L = str(input())

total = 0
kaigai = 0

for i in range(0, len(L)):
	if L[i] == 'a':
		if total < A + B:
			print('Yes')
			total += 1
		else:
			print('No')
	elif L[i] == 'b':
		if total < A + B and kaigai < B:
			print('Yes')
			total += 1
			kaigai += 1
		else:
			print('No')
	else:
		print('No')
Buggy code:
N,A,B=map(int,input().split())
S=input()
cnt_a=0
cnt_b=0
for i in range(N):
    if S[i]=='a':
        cnt_a+=1
        if cnt_a+cnt_b<=A+B:
            print('Yes')
        else:
            print('No')
    elif S[i]=='b':
        cnt_b+=1
        if cnt_a+cnt_b<=A+B and cnt_b<=B:
            print('Yes') 
        else:
            print('No')
    else:
        print('No')

Fixed code:
N,A,B=map(int,input().split())
S=input()
cnt_a=0
cnt_b=0
for i in range(N):
    if cnt_a<A+B:
        if S[i]=='a':
            cnt_a+=1
            print('Yes')
        elif S[i]== 'b' and cnt_b<B:
            cnt_b+=1
            cnt_a+=1
            print('Yes')
        else:
            print('No')
    else:
        print('No')
Buggy code:
N,A,B = [ int(i) for i in input().split() ]
S = input()

passCount = 0
overseaPassCount = 1
for k,v in enumerate(S):
  if v == "c":
    print("No")
  elif v == "b":
    print("Yes" if passCount<A+B and overseaPassCount<=B else "No")
    overseaPassCount += 1
    passCount += 1
  elif v == "a":
    print("Yes" if passCount<A+B else "No")
    passCount += 1
  else :
    None



Fixed code:
N,A,B = [ int(i) for i in input().split() ]
S = input()

passCount = 0
overseaPassCount = 1
for k,v in enumerate(S):
  if v == "c":
    print("No")
  elif v == "b":
    if passCount<A+B and overseaPassCount<=B :
      print("Yes")
      overseaPassCount += 1
      passCount += 1
    else:
      print("No")
  elif v == "a":
    if passCount<A+B :
      print("Yes")
      passCount += 1
    else:
      print("No")

  else :
    None
Buggy code:
N, A, B = map(int,input().split())
S = input()

a_counter = 0
b_counter = 0

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

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

a_counter = 0
b_counter = 0

for i in range(N):
  s = S[0]
  if s == "a" and a_counter + b_counter <A+B:
    a_counter += 1
    print("Yes")
  elif s == "b" and b_counter < B and a_counter + b_counter <A+B:
    b_counter += 1
    print("Yes")
  else:
    print("No")
  
  S = S[1:]
Buggy code:
n,in,out=map(int,input().split())
b=input()
kokunai=0
kaigai=0
for i in range(n):
  if(b[i]=='c'):
    print('No')
  else if(b[i]=='a'):
    if(kokunai+kaigai>=in+out):
      print('No')
    else:
      kokunai=kokunai+1
      print('Yes')
  else:
    if(kokunai+kaigai>=in+put or kaigai>=out):
      print('No')
    else:
      print('Yes')

Fixed code:
n,nai,out=map(int,input().split())
b=input()
kokunai=0
kaigai=0
for i in range(n):
  if(b[i]=='c'):
    print('No')
  elif(b[i]=='a'):
    if(kokunai+kaigai>=nai+out):
      print('No')
    else:
      kokunai=kokunai+1
      print('Yes')
  else:
    if(kokunai+kaigai>=nai+out or kaigai>=out):
      print('No')
    else:
      print('Yes')
      kaigai=kaigai+1
Buggy code:
n,a,b=map(int,input().split())
s=input()
x,y=0,0
for i in range(n):
    if s[i]=='a':
        if x+y<a+b:
            x+=1
            print("Yes")
        else:
            print("NO")
    elif s[i]=='b':
        if x+y<a+b and y<b:
            y+=1
            print("YES")
        else:
            print("NO")
    else:
        print("NO")

Fixed code:
n,a,b=map(int,input().split())
s=input()
x,y=0,0
for i in range(n):
    if s[i]=='a':
        if x+y<a+b:
            x+=1
            print("Yes")
        else:
            print("No")
    elif s[i]=='b':
        if x+y<a+b and y<b:
            y+=1
            print("Yes")
        else:
            print("No")
    else:
        print("No")
Buggy code:
N, A, B = (int(x) for x in input().split())

x = input()
y = list(x)
count_a = 0
count_b = 0

for i in range(0, N):
    if (y[i] == "a"):
        if(count_a + count_b < (A + B)):
            print("Yes")
            count_a += 1
        elif(count_a + count_b >= (A + B)):
            print("No")
    
    elif(y[i] == "b"):
        if(count_a + count_b < (A + B) and count_b <= B):
            print("Yes")
            count_b += 1
        elif(count_a + count_b >= (A + B)):
            print("No")
    
    elif(y[i] == "c"):
        print("No")
        
    
        





Fixed code:
N, A, B = (int(x) for x in input().split())

x = input()
y = list(x)
count_a = 0
count_b = 0

for i in range(0, N):
    if (y[i] == "a"):
        if(count_a + count_b < (A + B)):
            print("Yes")
            count_a += 1
        else:
            print("No")
    
    elif(y[i] == "b"):
        if(count_a + count_b < (A + B) and count_b < B):
            print("Yes")
            count_b += 1
        else:
            print("No")
    
    elif(y[i] == "c"):
        print("No")
Buggy code:
l=list(map(int,input().split()))
participant=list(input())
passnum=l[1]+l[2]
b=0
for i in range(l[0]):
    if participant[i]=='a' and passnum>0:
        participant[i]='Yes'
        passnum-=1
    elif passnum==0:
        break
if passnum>0:
    for i in range(l[0]):
        if participant[i]=='b' and passnum>0 and b<l[2]:
            participant[i]='Yes'
            passnum-=1
            b+=1
        elif b==l[2]:
            break
        elif passnum==0:
            break
for i in range(l[0]):
    if participant[i]!='Yes':
        participant[i]='No'
for i in range(l[0]):
    print(participant[i])

Fixed code:
l=list(map(int,input().split()))
participant=list(input())
passnum=l[1]+l[2]
b=0
for i in range(l[0]):
    if participant[i]=='a' and passnum>0:
        participant[i]='Yes'
        passnum-=1
    elif participant[i]=='b' and passnum>0 and b<l[2]:
            participant[i]='Yes'
            passnum-=1
            b+=1
    elif passnum==0:
        break
for i in range(l[0]):
    if participant[i]!='Yes':
        participant[i]='No'
for i in range(l[0]):
    print(participant[i])
Buggy code:
n,a,b = map(int, input().split())
s = input()
c = 0
bi = 0
for i in range(n):
    if s[i] == "a" and c < a+b:
        print("Yes")
        c += 1
    elif s[i] == "b" and c < a+b and bi <= b:
        print("Yes")
        bi += 1
        c += 1
    else:
        print("No")
    

Fixed code:
n,a,b = map(int, input().split())
s = input()
c = 0
d = 1
for i in range(n):
    if s[i] == "a" and c <(a+b):
        print("Yes")
        c += 1
    elif s[i] == "b" and c < (a+b) and d <= b:
        print("Yes")
        c += 1
        d += 1
    else:
        print("No")
Buggy code:
n, a, b = map(int, input().split())
s = input()
print(len(s))
total_cnt = 0
b_cnt = 0
ans = ["No"]*n

for i in range(n):
    if total_cnt >= a+b:
        break
    if s[i] == "c":
        continue
    if s[i] == "a":
        total_cnt += 1
        ans[i] = "Yes"
    if s[i] == "b":
        b_cnt += 1
        if b_cnt <= b:
            ans[i] = "Yes"

for i in range(n):
    print(ans[i])


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

total_cnt = 0
b_cnt = 0
ans = ["No"]*n

for i in range(n):
    if total_cnt >= a+b:
        break
    if s[i] == "c":
        continue
    if s[i] == "a":
        total_cnt += 1
        ans[i] = "Yes"
    if s[i] == "b":
        b_cnt += 1
        if b_cnt <= b:
            total_cnt += 1
            ans[i] = "Yes"

for i in range(n):
    print(ans[i])
Buggy code:
def main():
    quantity, A, B = map(int, input().split())
    l = list(input())
    yes = 0
    abroad = 0

    for i in range(quantity):
        if l[i] == 'a':
            if yes < (A + B):
                print('Yes')
                yes = yes + 1
            else:
                print('No')
        
        if l[i] == 'b':
            if yes < (A + B) and abroad <= B:
                print('Yes')
                abroad = abroad + 1
                yes = yes + 1

            else:
                print('No')
        
        if l[i] == 'c':
            print('No')

main()

Fixed code:
def main():
    quantity, A, B = map(int, input().split())
    l = list(input())
    yes = 0
    abroad = 0

    for i in range(quantity):
        if l[i] == 'a':
            if yes < (A + B):
                print('Yes')
                yes = yes + 1
            else:
                print('No')
        
        if l[i] == 'b':
            abroad = abroad + 1
            if yes < (A + B) and abroad <= B:
                print('Yes')
                yes = yes + 1

            else:
                print('No')
        
        if l[i] == 'c':
            print('No')

main()
Buggy code:
N,A,B = map(int,input().split())
S =input()
a = 0
b = 0

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

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

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

ans = []
df = 0
f = 0

for i in range(N):
  s = S[i]
  if s == 'c':
    ans.append('No')
    continue
  elif s == 'a':
    df += 1
    if df <= A:
      ans.append('Yes')
    else:
      ans.append('No')
  elif s == 'b':
    df += 1
    f += 1
    if df <= A and f <= B:
      ans.append('Yes')
    else:
      ans.append('No')
      
print('\n'.join(ans))
      

Fixed code:
N,A,B = map(int,input().split())
S = list(input())

C = A + B
ans = []
df = 0
f = 0

for i in range(N):
  s = S[i]
  if s == 'c':
    ans.append('No')
    continue
  elif s == 'a':
    df += 1
    if df <= C:
      ans.append('Yes')
    else:
      ans.append('No')
  elif s == 'b':
    df += 1
    f += 1
    if df <= C and f <= B:
      ans.append('Yes')
    else:
      df -= 1
      ans.append('No')
      
print('\n'.join(ans))
Buggy code:
n,A,B=map(int,input().split())
contestant=list(input())
aa=0
bb=0
for i in range(n):
  if contestant[i]=="c":
    print("No")
  elif contestant[i]=="b":
    if aa+bb<A+B and bb<B:
      print("Yes")
    else:
      print("No")
    bb+=1
    
  elif contestant[i]=="a":
    if aa+bb<A+B+1 :
      print("Yes")
    else:
      print("No")
    aa+=1

Fixed code:
n,A,B=map(int,input().split())
contestant=list(input())
aa=0
bb=0
for i in range(n):
  if contestant[i]=="c":
    print("No")
  elif contestant[i]=="b":
    if aa+bb<A+B and bb<B:
      print("Yes")
      bb+=1
    else:
      print("No")
    
  elif contestant[i]=="a":
    if aa+bb<A+B:
      print("Yes")
    else:
      print("No")
    aa+=1
Buggy code:
N, A, B = map(int, input().split())
S = list(input().split)
 
ok_count = 0
ok_fcount = 0
for i in range(N):
  if S[i] == a:
    if ok_count < A+B-1
      print('Yes')
      ok_count +=1
      
    else:
      print('No')
      
  elif S[i] == b:
    if ok_count <= A+B-1 and ok_fcount < B-1:
      print('Yes')
      ok_count+=1
      ok_fcount+=1
      
    else:
      print('No')
      
  else:
    print('No')

Fixed code:
N, A, B = map(int, input().split())
S = input()
 
ok_count = 0
ok_fcount = 0
for i in range(N):
  if S[i] == 'a':
    if ok_count < A+B:
      print('Yes')
      ok_count +=1
      
    else:
      print('No')
      
  elif S[i] == 'b':
    if ok_count < A+B and ok_fcount < B:
      print('Yes')
      ok_count+=1
      ok_fcount+=1
      
    else:
      print('No')
      
  else:
    print('No')
Buggy code:
from sys import stdin
from math import ceil, floor
n,a,b=[int(x) for x in stdin.readline().rstrip().split()]
s=list(stdin.readline().rstrip())
c=a+b
d=e=m=0
for i in range(n):
    if d>=c:
        m=i+1
        break
    if d<c and s[i]=="a":
        print("Yes")
        d+=1
    elif d<c and e<b and s[i]=="b":
        print("Yes")
        d+=1
        e+=1
    else:
        print("No")
if m != 0:
    for i in range(n-m):
        print("No")

Fixed code:
from sys import stdin
from math import ceil, floor
n,a,b=[int(x) for x in stdin.readline().rstrip().split()]
s=list(stdin.readline().rstrip())
c=a+b
d=e=m=0
for i in range(n):
    if d<c and s[i]=="a":
        print("Yes")
        d+=1
    elif d<c and e<b and s[i]=="b":
        print("Yes")
        d+=1
        e+=1
    else:
        print("No")
    if d>=c:
        m=i+1
        break
if m != 0:
    for i in range(n-m):
        print("No")
Buggy code:
from sys import stdin
from math import ceil, floor
n, a, b = [int(x) for x in stdin.readline().rstrip().split()]
s = list(stdin.readline().rstrip())
c = a + b
d = 0
e = 0
for i in range(n):
    if d < c and s[i] == "a":
        print("YES")
        d += 1
    elif d < c and e < b and s[i] == "b":
        print("YES")
        d += 1
        e += 1
    else:
        print("NO")

Fixed code:
from sys import stdin
from math import ceil, floor
n, a, b = [int(x) for x in stdin.readline().rstrip().split()]
s = list(stdin.readline().rstrip())
c = a + b
d = 0
e = 0
for i in range(n):
    if d < c and s[i] == "a":
        print("Yes")
        d += 1
    elif d < c and e < b and s[i] == "b":
        print("Yes")
        d += 1
        e += 1
    else:
        print("No")
Buggy code:
N, A, B = map(int, input().split())
S = input()
domestic = 0
abroad = 0
for i in range(N):
    if S[i] == 'a':
        if domestic+abroad < A+B:
            print('Yes')
            domestic += 1
        else:
            print('No')
    elif S[i] == 'b':
        if domestic+abroad < A+B and abroad <= B:
            print('Yes')
            abroad += 1
        else:
            print('No')
    else:
        print('No')

Fixed code:
N, A, B = map(int, input().split())
S = input()
domestic = 0
abroad = 0
for i in range(N):
    if S[i] == 'a':
        if domestic+abroad < A+B:
            print('Yes')
            domestic += 1
        else:
            print('No')
    elif S[i] == 'b':
        if domestic+abroad < A+B and abroad < B:
            print('Yes')
            abroad += 1
        else:
            print('No')
    else:
        print('No')
Buggy code:
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, A, B = input_number_list()
    S = input()
    total = 0
    total_f = 0
    for c in S:
        isNg = False
        if c == 'a' and total < A + B:
            total += 1
        elif c == 'b' and total < A + B and total_f < B:
            total += 1
            total_f += 1
        else:
            isNg = True
        print('YNeos'[isNg::2])


if __name__ == '__main__':
    main()


Fixed code:
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, A, B = input_number_list()
    S = input()
    total = 0
    total_f = 0
    for c in S[:-1]:
        isNg = False
        if c == 'a' and total < A + B:
            total += 1
        elif c == 'b' and total < A + B and total_f < B:
            total += 1
            total_f += 1
        else:
            isNg = True
        print('YNeos'[isNg::2])


if __name__ == '__main__':
    main()
Buggy code:
n, a, b = map(int, input().split())
s=input()

tp=0
up=0

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

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

tp=0
up=0

for i in range(n):
  if tp >= a+b:
    print('No')
  elif s[i]=='a':
    print('Yes')
    tp+=1
  elif s[i]=='b':
    if up < b:
      print('Yes')
      tp+=1
      up+=1
    else:
      print('No')
  else:
    print('No')
Buggy code:
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')
        else:
            print('No')
        total +=1
    elif s=='b':
        if total<A+B and total2<=B:
            print('Yes')
            total2+=1
        else:
            print('No')
        total +=1
    else:
        print('No')


Fixed code:
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')
Buggy code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,a,b = LI()
    s = input()
    su = sb = 0
    for i in range(n):
        if s[i] == "a":
            if su < a+b:
                su += 1
                print("Yes")
            else:
                print("No")
        else:
            if su < a+b and sb < b:
                su += 1
                sb += 1
                print("Yes")
            else:
                print("No")
    return

#Solve
if __name__ == "__main__":
    solve()


Fixed code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,a,b = LI()
    s = input()
    su = sb = 0
    c = a+b
    for i in range(n):
        if su >= c:
            print("No")
            continue
        if s[i] == "a":
            su += 1
            print("Yes")
        elif s[i] == "b":
            if sb < b:
                su += 1
                sb += 1
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    return

#Solve
if __name__ == "__main__":
    solve()
Buggy code:
N, A, B = list(map(int, input().split()))
S = list(input())
a = 0
b = 0
for i in range(N):
	if S[i] == "a":
		if a < A + B:
			print("Yes")
		else:
			print("No")
		a += 1
	elif S[i] == "b":
		if a + b < A + B and  b < B:
			print("Yes")
		else:
			print("No")
		b += 1
	else:
		print("No")

Fixed code:
N, A, B = list(map(int, input().split()))
S = list(input())
a = 0
b = 0
ps = 0
for i in range(N):
	if S[i] == "a":
		if ps < A + B:
			print("Yes")
			ps += 1
		else:
			print("No")
		a += 1
	elif S[i] == "b":
		if ps < A + B and  b < B:
			print("Yes")
			b += 1
			ps += 1
		else:
			print("No")
		
	else:
		print("No")
Buggy code:
N, A, B = input().split(' ')
N = int(N)
A = int(A)
B = int(B)
S = []
S = list(input())
JS = 0
AS = 0
OT = 0

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

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

for i in range(N):
  if S[i] == 'a' and A+B > JS+AS:
    print('Yes')
    JS += 1
  elif S[i] == 'b' and A+B > JS+AS and AS < B:
    print('Yes')
    AS += 1
  else:
    print('No')
Buggy code:
N, A, B = map(int, input().split())
S = input()
passed = 0
foreigner = 0
for s in S:
  if s == "c":
    print("No")
  elif s == "a":
    if passed < A + B:
      print("Yes")
      passed += 1
    else:
      print("No")
  elif s == "b":
    if passed < A + B and foreigner <= B:
      print("Yes")
      passed += 1
      foreigner += 1
    else:
      print("No")

Fixed code:
N, A, B = map(int, input().split())
S = input()
passed = 0
foreigner = 0
for s in S:
  if s == "c":
    print("No")
  elif s == "a":
    if passed < A + B:
      print("Yes")
      passed += 1
    else:
      print("No")
  elif s == "b":
    if passed < A + B and foreigner < B:
      print("Yes")
      passed += 1
      foreigner += 1
    else:
      print("No")
Buggy code:
n, a, b = map(int, input().split())
s = list(input())
line = a + b
rank = 0
bnum = 0
for student in s:
    if student == "a" or student== "b":
        if rank <= line:
            rank += 1
            if student == "a":
                print("Yes")
            else:
                bnum += 1
                if bnum <= b:
                    print("Yes")
                else:
                    print("No")
        else:
            print("No")
    else:
        # rank +=1
        print("No")

Fixed code:
n, a, b = map(int, input().split())
s = list(input())
line = a + b
rank = 1
bnum = 0
for student in s:
    if student == "a" or student== "b":
        if rank <= line:

            if student == "a":
                print("Yes")
                rank += 1
            else:
                bnum += 1
                if bnum <= b:
                    print("Yes")
                    rank += 1
                else:
                    print("No")
        else:
            print("No")
    else:
        # rank +=1
        print("No")
Buggy code:
n,a,b=input().split(" ")
n=int(n)
a=int(a)
b=int(b)
lst=input()
cnt=0
cnt2=0
for i in range(n):
  if lst[i]=="a":
    if cnt<a+b:
      print("Yes")
      cnt+=1
    else:
      print("No")
  elif lst[i]=="b":
    if cnt<a+b and cnt2<=b:
      print("Yes")
      cnt+=1
      cnt2+=1
    else:
      print("No")
  else:
    print("No")

Fixed code:
n,a,b=input().split(" ")
n=int(n)
a=int(a)
b=int(b)
lst=input()
cnt=0
cnt2=0
for i in range(n):
  if lst[i]=="a":
    if cnt<a+b:
      print("Yes")
      cnt+=1
    else:
      print("No")
  elif lst[i]=="b":
    if cnt<a+b and cnt2<b:
      print("Yes")
      cnt+=1
      cnt2+=1
    else:
      print("No")
  else:
    print("No")
Buggy code:
N, A, B = map(int, input().split())
S = input()
a = b = 0
for s in S:
  if s == 'a' and a+b < A+B:
    print('Yes')
    a += 1
  elif s == 'b' and b < B:
    print('Yes')
    b += 1
  else:
    print('No')

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