qyliang/CodeNanoFix huggingface dataset:
Buggy code:
A = "CODEFESTIVAL2016"
S = input()
print(sum(1 if s == a else 0 for s, a in zip(A, S)))


Fixed code:
A = "CODEFESTIVAL2016"
S = input()
print(sum(0 if s == a else 1 for s, a in zip(A, S)))
Buggy code:
s=input()
a='CODEFESTIVAL2016'
cnt=0
for i in range(len(s)):
    if s[i]!=a[i]:
        cnt+=1
print(ans)

Fixed code:
a = "CODEFESTIVAL2016"
cnt = 0
s = input()

for i in range(len(s)):
    if a[i] != s[i]:
        cnt += 1

print(cnt)
Buggy code:
s = raw_input()

c = "CODEFESTIVAL2016"

ans  = 0
for i in range(len(c)):
    if s[i] != c[[i]:
                 ans += 1
print ans


Fixed code:
s = input()
c = 'CODEFESTIVAL2016'
ans = 0
for i in range(len(s)):
    if s[i] != c[i]:
        ans += 1
print(ans)
Buggy code:
N,A,B=[int(s) for s in input().split(" ")]
S=str(input())

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

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

Count=0
b=0
for i in range(N):
    if Count<A+B:
        if S[i]!="c":
                if S[i]=="b":
                    if b<B:
                        print("Yes")
                        b+=1
                        Count+=1
                    else:
                        print("No")
                else:
                    print("Yes")
                    Count+=1
        else:
            print("No")
    else:
        print("No")
Buggy code:
n,a,b=map(int,input().split())
cab,cb=0,0
for i in range(n):
  s=input()
  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')

Fixed code:
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')
Buggy code:
N,A,B=map(int,input().split())
S=str(input())
M=A+B
K=0
Foreign=0
for j in S:
  if j=="c":
    print("No")
  else:
    K+=1
    if j=="a":
      if K<=M:
        print("Yes")
      else:
        print("No")
    else:
      Foreign+=1
      if Foreign<=B and K<=M:
        print("Yes")
      else:
        print("No")
   
    

Fixed code:
N,A,B=map(int,input().split())
S=str(input())
M=A+B
K=0
Foreign=0
for j in S:
  if j=="c":
    print("No")
  else:
    if j=="a":
      K+=1
      if K<=M:
        print("Yes")
      else:
        print("No")
    else:
      Foreign+=1
      if Foreign<=B:
        K+=1
        if K<=M:
          print("Yes")
        else:
          print("No")
      else:
        print("No")
Buggy code:
nums = list(map(int, input().split()))
s=input()
print(nums[0], nums[1], nums[2])
print(s)
N=nums[0]
A=nums[1]
B=nums[2]
cA=0
cB=0
for i in range(N):
	if(s[i:i+1] == "a"):
#		print(s[i:i+1])
		if((cA+cB)<(A+B)):
			print("Yes")
		else:
			print("No")
		cA+=1
	elif(s[i:i+1]=="b"):
#		print(s[i:i+1])
		if((cA+cB)<(A+B)):
			if(cB<B):
				print("Yes")
			else:
				print("No")
		else:
			print("No")	
		cB += 1
	elif(s[i:i+1]=="c"):
		print("No")


Fixed code:
nums = list(map(int, input().split()))
s=input()
#print(nums[0], nums[1], nums[2])
#print(s)
N=nums[0]
A=nums[1]
B=nums[2]
cA=0
cB=0
for i in range(N):
	if(s[i:i+1] == "a"):
#		print(s[i:i+1])
		if((cA+cB)<(A+B)):
			print("Yes")
			cA+=1
		else:
			print("No")
	elif(s[i:i+1]=="b"):
#		print(s[i:i+1])
		if((cA+cB)<(A+B)):
			if(cB<B):
				print("Yes")
				cB+=1
			else:
				print("No")
		else:
			print("No")	
		
	elif(s[i:i+1]=="c"):
		print("No")
Buggy code:
N, A, B = map(int, input().split())
S = input()
tol = 0
bcnt = 0
ans = []
for c in S:
    if c == 'a':
        tol += 1
        if tol <= (A+B):
            ans.append('Yes')
        else:
            ans.append('No')
    elif c == 'b':
        tol += 1
        bcnt += 1
        if tol <= (A+B) and bcnt <= B:
            ans.append('Yes')
        else:
            ans.append('No')
    else:
        ans.append('No')
        continue
for s in ans:
    print(s)

Fixed code:
N, A, B = map(int, input().split())
S = input()
tol = 0
bcnt = 0
ans = []
for c in S:
    if c == 'a':
        if tol < (A+B):
            tol += 1
            ans.append('Yes')
        else:
            ans.append('No')
    elif c == 'b':
        bcnt += 1
        if tol < (A+B) and bcnt <= B:
            tol += 1
            ans.append('Yes')
        else:
            ans.append('No')
    else:
        ans.append('No')
        continue
for s in ans:
    print(s)
Buggy code:
n,a,b=map(int,input().split())
s=input()
japan=0
abroad=0
for i in range(n):
    p=s[i]
    if p == 'c':
        print('No')
        continue
    if p == 'a' and japan+abroad < a+b:
        japan+=1
        print('Yes')
        continue
    elif p=='a':
        print('No')
        continue
    if p=='b' and japan+abroad < a+b and abroad <= b:
        print('Yes')
        abroad+=1
        continue
    else:
        print('No')
        continue



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

x = A + B
cnt = 1
rank = 1
for i in range(N):
    y = s[i : i+1]
    if cnt <= x:
        if y == "a":
            print("yes")
            cnt += 1
        elif y == "b" and rank <= B:
            print("yes")
            cnt += 1
            rank += 1
        else:
            print("No")
    else:
        print("No")

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

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

Fixed code:
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")
Buggy code:
n, A, B = map(int, input().split())
a, b = 0
s = input()
for i in range(n):
  s_i = s[i]
  if s_i == 'a':
    if (a + b) < (A + B):
      a += 1
      print('Yes')
	else:
      print('No')
  elif s_i == 'b':
    if ((a + b) < (A + B)) & (b < B):
      b += 1
      print('Yes')
    else:
      print('No')
  else:
    print('No')
    

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



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

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

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

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


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

Fixed code:
n,A,B=map(int,input().split())
s=list(input())
cnt=0
cnt_b=0
for i in range(n):
	if s[i]=='a' and cnt<A+B:
		print('Yes')
		cnt+=1
	elif s[i]=='b' and cnt<A+B and cnt_b<B:
		print('Yes')
		cnt_b+=1
		cnt+=1
	else:
		print('No')
Buggy code:
datalist=list(map(int,input().split()))
N,A,B=datalist[0],datalist[1],datalist[2]
strings=str(input())
na,nb=0,0
out=[]
for i in range(len(strings)):
  if strings[i]=="a":
    if na + nb < A+B:
      out.append("YES")
      na += 1
    else:
      out.append("NO")
  elif strings[i]=="b":
    if na + nb < A+B:
      if nb < B:
        out.append("YES")
        nb += 1
      else:
        out.append("NO")
    else:
      out.append("NO")
  else:
    out.append("NO")
    
print("\n".join(out))

Fixed code:
datalist=list(map(int,input().split()))
N, A, B = datalist[0], datalist[1], datalist[2]
strings=str(input())
na,nb=0,0
out=[]
for i in range(len(strings)):
  if strings[i]=="a":
    if na + nb < A+B:
      out.append("Yes")
      na += 1
    else:
      out.append("No")
  elif strings[i]=="b":
    if na + nb < A+B:
      if nb < B:
        out.append("Yes")
        nb += 1
      else:
        out.append("No")
    else:
      out.append("No")
  else:
    out.append("No")
print("\n".join(out))
Buggy code:
N, A, B = map(int, input().split())
S = input()
counta = 0
countb = 0
for s in S:
    if s =='a':
        counta += 1
        if counta + countb <= A + B:
            print('Yes')
        else:
            print('No')
    if s =='b':
        countb += 1
        if counta + countb <= A + B:
            if countb <= B:
                print('Yes')
            else:
                print('No')                
        else:
            print('No')
    if s=='c':
        print('No')


Fixed code:
N, A, B = map(int, input().split())
S = input()
counta = 0
countb = 0
for s in S:
    if s =='a':
        if counta + countb < A + B:
            counta += 1
            print('Yes')
        else:
            print('No')
    if s =='b':
        if counta + countb < A + B:
            if countb < B:
                countb += 1
                print('Yes')
            else:
                print('No')                
        else:
            print('No')
    if s=='c':
        print('No')
Buggy code:
N, A, B = list(map(int, input().split()))
S = input()
y, yab = 0, 0

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

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

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

Fixed code:
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")
Buggy code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    b = 0
    N, A, B =LI()
    s = S()
    PASS = 0
    for i in range(N):
        if s[i] == "c":
            print("No")
            continue
        if PASS < A + B:
            if s[i] == "a":
                PASS += 1
                print("Yes")
            else:
                if b < B:
                    PASS += 1
                    b += 1
                    print("Yes")
                else:
                    print("No")
        else:
            print("No")
    print(PASS)

    return


#main
if __name__ == '__main__':
    solve()


Fixed code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    b = 0
    N, A, B =LI()
    s = S()
    PASS = 0
    for i in range(N):
        if s[i] == "c":
            print("No")
            continue
        if PASS < A + B:
            if s[i] == "a":
                PASS += 1
                print("Yes")
            else:
                if b < B:
                    PASS += 1
                    b += 1
                    print("Yes")
                else:
                    print("No")
        else:
            print("No")

    return


#main
if __name__ == '__main__':
    solve()
Buggy code:
import numpy as np
import sys

input = sys.stdin.readline

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

S = input()

nai = 0
gai = 0


goukaku = 0

for i in range(len(S)):
    if S[i] != 'c':
        goukaku+=1

for i in range(len(S)):
    if S[i] == 'a':
        nai+=1
        if (i+1) < goukaku:
            print("Yes")
        else:
            print("No")

    elif S[i] == 'b':
        gai+=1
        if (i+1) < goukaku and gai <= B:
            print("Yes")
        else:
            print("No")

    elif S[i] == 'c':
        print("No")

Fixed code:
import numpy as np
import sys

input = sys.stdin.readline

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

S = input()

nai = 0
gai = 0


goukaku = 0
for i in range(len(S)):
    if S[i] == 'a':
        nai+=1
        if goukaku < A+B:
            goukaku+=1
            print("Yes")
        else:
            print("No")

    elif S[i] == 'b':
        gai+=1
        if goukaku < A+B and gai <= B:
            goukaku+=1
            print("Yes")
        else:
            print("No")

    elif S[i] == 'c':
        print("No")
Buggy code:
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 b>0:
    b-=1
    t-=1
    print("Yes")
  else:
    print("No")

Fixed code:
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")
Buggy code:
n,a,b = map(int,input().split())
S = input()
passed = 0
f_passed = 0
for s in S:
  if s == "a":
    if passed <= a + b:
      print("Yes")
      passed += 1
    else:
      print("No")
  elif s == "b":
    if passed <= a + b and f_passed <= b:
      print("Yes")
      passed += 1
      f_passed += 1
    else:
      print("No")
  else:
    print("No")

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

import sys

T = A + B
Ta = B

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


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

import sys

T = A + B
Ta = B

for p in S:
  if p == "c":
    print("No")
    continue
    
  elif p == "a":
    if T > 0:
      print("Yes")
      T -= 1
    else:
      print("No")
      
  else:
    if T > 0 and Ta > 0:
      print("Yes")
      Ta -= 1
      T -= 1
    else:
      print("No")
Buggy code:
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:
            print('Yes')
        else:
            print('No')
        domestic += 1
    elif i == 'b':
        if domestic + abroad <= a + b and abroad <= b:
            print('Yes')
        else:
            print('No')
        abroad += 1
    else:
        print('No')


Fixed code:
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')
Buggy code:
n, a, b = map(int, input().split())
s = list(input())

result = []
cnt = 0
cnt_b = 0
limit = a + b

for student in s:
    if student == c:
        result.append("No")
    elif (student == "a") & (cnt < limit):
        result.append("Yes")
        cnt += 1
    elif (student == "b") & (cnt < limit) & (cnt_b < b):
        result.append("Yes")
        cnt += 1
        cnt_b += 1
    else:
        result.append("No")
print("\n".join(result))

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

result = []
cnt = 0
cnt_b = 0
limit = a + b

for student in s:
    if student == "c":
        result.append("No")
    elif (student == "a") & (cnt < limit):
        result.append("Yes")
        cnt += 1
    elif (student == "b") & (cnt < limit) & (cnt_b < b):
        result.append("Yes")
        cnt += 1
        cnt_b += 1
    else:
        result.append("No")
print("\n".join(result))
Buggy code:
n,a,b = map(int, input().split())
s = input()
kaigai = 0
sankasha = 0
for i in range(n):
    if s[i] == "c":
        print("No")
    else:
        sankasha += 1
        if sankasha <= a+b:
            if s[i] == "b":
                kaigai += 1
                if kaigai <= b:
                    print("Yes")
                else:
                    print("No")
            else:
                print("Yes")
        else:
            print("No")

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

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

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

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

a = 0
b = 0

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