ZhenlongDai/ACPR huggingface dataset:
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
b=[0]
for i in range(1,10):
  if a<=111*i:
    b.append(a)
print(max(b*111))

Failing test case input:
528

Expected output:
555


Actual output:
528


Fixed submission (verdict: Accepted):
a=int(input())
b=[0]
for i in range(10):
  if a>111*i:
    b.append(111*(i+1))
print(max(b))

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=list(input())
A = B = C = ''
if a[0] == a[1] and a[0] == a[2]:
    for _ in range(3):
        A += str(a[0])
    print(A)
else:
    if a[1] >= a[0] :
       a[0] = int(a[0]) + 1
       for i in range(3):
        B += str(a[0])
    
       print(B)
    
    else:
       for i in range(3):
        C += str(a[0])
    
       print(C)

Failing test case input:
662

Expected output:
666


Actual output:
777


Fixed submission (verdict: Accepted):
a=list(input())
A = B = C = ''
if a[0] == a[1] and a[0] == a[2] or a[0] >= a[2] and a[0] == a[1]:
    for _ in range(3):
        A += str(a[0])
    print(A)
else:
    if a[1] >= a[0] :
       a[0] = int(a[0]) + 1
       for i in range(3):
        B += str(a[0])
    
       print(B)

    else:
       for i in range(3):
        C += str(a[0])
    
       print(C)

Problem: p03243
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
N = int(input())
for i in range(0,112):
  n = list(str(N+i))
  print(n)
  if n[0] == n[1] == n[2]:
    print(N+i)
    sys.exit()

Failing test case input:
528

Expected output:
555


Actual output:
['5', '2', '8']
['5', '2', '9']
['5', '3', '0']
['5', '3', '1']
['5', '3', '2']
['5', '3', '3']
['5', '3', '4']
['5', '3', '5']
['5', '3', '6']
['5', '3', '7']
['5', '3', '8']
['5', '3', '9']
['5', '4', '0']
['5', '4', '1']
['5', '4', '2']
['5', '4', '3']
['5', '4', '4']
['5', '4', '5']
['5', '4', '6']
['5', '4', '7']
['5', '4', '8']
['5', '4', '9']
['5', '5', '0']
['5', '5', '1']
['5', '5', '2']
['5', '5', '3']
['5', '5', '4']
['5', '5', '5']
555


Fixed submission (verdict: Accepted):
import sys
N = int(input())
for i in range(0,112):
  n = list(str(N+i))
  if n[0] == n[1] == n[2]:
    print(N+i)
    sys.exit()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
i=0
for i in range(8):
    if 111*i<N and N<=111*(i+1):
        print(111*(i+1))
        break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N=int(input())
i=0
for i in range(9):
    if 111*i<N and N<=111*(i+1):
        print(111*(i+1))
        break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = str(input())

list = [int(c)+10*int(c)+100*int(c) for c in N]
list.sort()

x = 0
for i in range(len(N)):
    if list[i] < int(N):
        continue
    else:
        x = list[i]
print(x)

Failing test case input:
528

Expected output:
555


Actual output:
888


Fixed submission (verdict: Accepted):
N = str(input())

list = [111*int(c) for c in '123456789']
list.sort()

x = 0
for number in list:
    if number < int(N):
        continue
    else:
        x = number
        break
print(x)
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())

list = [111,222,333,444,555,666,777,888,999]
ans = 0
for l in list:
  if N < l:
    ans = l
  else:
    break

print(ans)

Failing test case input:
846

Expected output:
888


Actual output:
0


Fixed submission (verdict: Accepted):

N = int(input())

list = [111,222,333,444,555,666,777,888,999, 1000000]
ans = 0
for l in list:
  if N > l:
    continue
  else:
    ans =l
    break

print(ans)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input().strip())
for i in range(1,9):
  if N <= 111*i:
    print(111*i)
    break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input().strip())
for i in range(10):
  if N <= 111*i:
    print(111*i)
    break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

for i in range(N, 999):
    s = str(i)
    if s[0] == s[1] == s[2]:
        print(i)
        break


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())

for i in range(N, 1000):
    s = str(i)
    if s[0] == s[1] == s[2]:
        print(i)
        break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

for i in range(1, 9, 1):
    str_i = str(i)
    str_x = "{}{}{}".format(str_i, str_i, str_i)
    x = int(str_x)
    if x >= N:
        break
print(x)


Failing test case input:
985

Expected output:
999


Actual output:
888


Fixed submission (verdict: Accepted):
N = int(input())

for i in range(1, 10, 1):
    str_i = str(i)
    str_x = "{}{}{}".format(str_i, str_i, str_i)
    x = int(str_x)
    if x >= N:
        break
print(x)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
numlist = [111, 222, 333, 444, 555, 666, 777, 888, 999]
for number in numlist:
    if number >= num:
        print(num)
        break

Failing test case input:
528

Expected output:
555


Actual output:
528


Fixed submission (verdict: Accepted):
num = int(input())
numlist = [111, 222, 333, 444, 555, 666, 777, 888, 999]
for number in numlist:
    if number >= num:
        print(number)
        break
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
s = input()

all = list(s)
count = 0
count_b = 0
for i in range(n - 1):
    if all[i] == 'a':
        if count < a + b:
            print('yes')
            count += 1
        else:
            print('no')
    if all[i] == 'b':
        if count < a + b and count_b <= b:
            print('yes')
            count += 1
            count_b += 1
        else:
            print('no')
    else:
        print('no')


Failing test case input:
10 2 3
abccabaabb

Expected output:
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No

Actual output:
yes
no
yes
no
no
yes
no
yes
yes
no
no
no
no


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
s = input()

all = list(s)
count = 0
count_b = 0
for i in all:
    if i == 'a':
        if count < a + b:
            print('Yes')
            count += 1
        else:
            print('No')
    elif i == 'b':
        if (count < a + b) and (count_b < b):
            print('Yes')
            count += 1
            count_b += 1
        else:
            print('No')
    else:
        print('No')

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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







Failing test case input:
10 1 0
abccabaabb

Expected output:
Yes
No
No
No
No
No
No
No
No
No


Actual output:
Yes
No
No
No
no
No
no
no
No
No


Fixed submission (verdict: Accepted):

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')
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
allr = abrr = 1

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

Failing test case input:
12 3 2
abaccababaac

Expected output:
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
No
No


Actual output:
Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
No
No


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
allr = abrr = 1

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

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input=sys.stdin.buffer.readline
n,a,b=map(int,input().split())
S=input()[:-1]
print(n,a,b,S)
for i in range(n):
    A=S[:i].count(97)
    B=S[:i].count(98)
    if S[i]==97 and A+B<=a+b:
        print("Yes")
        continue
    if S[i]==98 and A+B<a+b and B<b:
        print("Yes")
        continue
    else:print("No")

Failing test case input:
12 3 2
caababaccaba

Expected output:
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
No


Actual output:
12 3 2 b'caababaccaba'
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No


Fixed submission (verdict: Accepted):
import sys
input=sys.stdin.buffer.readline
n,a,b=map(int,input().split())
S=input()[:-1]
total=0
b_lim=0
for i in range(n):
    if S[i]==97 and total<a+b:
        print("Yes")
        total+=1
        continue
    if S[i]==98 and total<a+b and b_lim<b:
        print("Yes")
        total+=1
        b_lim+=1
        continue
    else:print("No")
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
12 5 -1
aabcbacabaab

Expected output:
Yes
Yes
No
No
No
Yes
No
Yes
No
No
No
No


Actual output:
Yes
Yes
No
No
No
Yes
No
Yes
No
Yes
No
No


Fixed submission (verdict: Accepted):
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")

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
(n,an,bn) = list(map(int,input().split()))
s = list(input())
count = 1
foreign = 1
for i in s:
  if i=='a' and an+bn >= count:
    print('Yes')
    count += 1
  elif i=='b' and an+bn > count and bn >= foreign:
    print('Yes')
    count += 1
    foreign += 1
  else:
    print('No')

Failing test case input:
12 3 2
abaccababaac

Expected output:
Yes
Yes
Yes
No
No
Yes
Yes
No
No
No
No
No


Actual output:
Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
No
No


Fixed submission (verdict: Accepted):
(n,an,bn) = list(map(int,input().split()))
s = list(input())
count = 1
foreign = 1
for i in s:

  if i=='a' and an+bn >= count:
    print('Yes')
    count += 1
  elif i=='b' and an+bn >= count and bn >= foreign:
    print('Yes')
    count += 1
    foreign += 1
  else:
    print('No')

Problem: p03971
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, A, B = map(int, input().split())
S = input()
a = 0
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')


Failing test case input:
12 3 2
caababaccaba

Expected output:
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
No


Actual output:
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
S = input()
a = 0
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')
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B=map(int,input().split())
S=input()

nowA=0
nowB=0

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


Failing test case input:
10 2 0
bbaacaccca

Expected output:
No
No
Yes
Yes
No
No
No
No
No
No


Actual output:
Yes
No
No
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
N,A,B=map(int,input().split())
S=input()

nowA=0
nowB=0

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

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
s = input()

all = list(s)
count = 0
count_b = 0
for i in all:
    if i == 'a':
        if count <= a + b:
            print('yes')
            count += 1
        else:
            print('no')
    if i == 'b':
        if count <= a + b and count_b <= b:
            print('yes')
            count += 1
            count_b += 1
        else:
            print('no')
    else:
        print('no')


Failing test case input:
10 2 2
bbaacaccba

Expected output:
Yes
Yes
Yes
Yes
No
No
No
No
No
No


Actual output:
yes
yes
yes
no
yes
no
no
yes
no
no
no
no
no
no


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
s = input()

all = list(s)
count = 0
count_b = 0
for i in all:
    if i == 'a':
        if count < a + b:
            print('Yes')
            count += 1
        else:
            print('No')
    elif i == 'b':
        if (count < a + b) and (count_b < b):
            print('Yes')
            count += 1
            count_b += 1
        else:
            print('No')
    else:
        print('No')

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")
  elif s_i=='b':
    if count<=a+b and foreign <= b:
      count+=1
      foreign+=1
      print("Yes")
  else:
    print("No")

Failing test case input:
12 5 -1
aabcbacabaab

Expected output:
Yes
Yes
No
No
No
Yes
No
Yes
No
No
No
No


Actual output:
Yes
Yes
No
Yes
No
Yes
Yes


Fixed submission (verdict: Accepted):
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")
Problem: p03971
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,a,b = map(int,input().split())
s = input()
maxa = a+b
maxb = b
counta = 0
countb = 0
for i in range(n):
  if s[i] == 'c':
    print("No")
  elif s[i] == 'b':
    if countb < maxb and counta < maxa:
      print("Yes")
      counta += 1
      countb += 1
    elif counta < maxa:
      print("NO")
    else:
      print("No")
  else:
    if counta < maxa:
      print("Yes")
    else:
      print("No")
    counta+=1


Failing test case input:
12 10 -1
cacbababcaab

Expected output:
No
Yes
No
No
Yes
No
Yes
No
No
Yes
Yes
No


Actual output:
No
Yes
No
NO
Yes
NO
Yes
NO
No
Yes
Yes
NO


Fixed submission (verdict: Accepted):
n,a,b = map(int,input().split())
s = input()
maxa = a+b
maxb = b
counta = 0
countb = 0
for i in range(n):
  if s[i] == 'c':
    print("No")
  elif s[i] == 'b':
    if countb < maxb and counta < maxa:
      print("Yes")
      counta += 1
      countb += 1
    elif counta < maxa:
      print("No")
    else:
      print("No")
  else:
    if counta < maxa:
      print("Yes")
    else:
      print("No")
    counta+=1

Problem: p03971
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,A,B=map(int,input().split())
S=input()
t_count=0
b_count=0
flag=None

for i in S:
  if i=="c":
    print("No")
  else:
    if i=="a":
      t_count+=1
      if t_count<=A+B:
        print("Yes")
      else:
        print("No")
    else:
      b_count+=1
      if b_count<=B:
        t_count+=1
        print("Yes")
      else:
        print("No")

Failing test case input:
10 2 2
abccacaabb

Expected output:
Yes
Yes
No
No
Yes
No
Yes
No
No
No


Actual output:
Yes
Yes
No
No
Yes
No
Yes
No
Yes
No


Fixed submission (verdict: Accepted):
N,A,B=map(int,input().split())
S=input()
t_count=0
b_count=0
flag=None

for i in S:
  if i=="c":
    print("No")
  else:
    if i=="a":
      t_count+=1
      if t_count<=A+B:
        print("Yes")
      else:
        print("No")
    else:
      b_count+=1
      if b_count<=B:
        t_count+=1
        if t_count<=A+B:
          print("Yes")
        else:
          print("No")
      else:
        print("No")
Problem: p03971
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,A,B = map(int,input().split())
S = input()

pass_num = 0

for i in S:
    if i == 'a':
        if (A + B)-1 >= pass_num:
            print('Yes')
            pass_num += 1
        else:
            print('No')
    elif i == 'b':
        if B-1 >= pass_num:
            print('Yes')
            pass_num += 1
        else:
            print('No')
    else:
        print('No')

Failing test case input:
10 2 1
abccabaabb

Expected output:
Yes
Yes
No
No
Yes
No
No
No
No
No


Actual output:
Yes
No
No
No
Yes
No
Yes
No
No
No


Fixed submission (verdict: Accepted):
N,A,B = map(int,input().split())
S = input()

pass_num = 0
pass_fo = 0

for i in S:
    if i == 'a':
        if (A + B)-1 >= pass_num:
            print('Yes')
            pass_num += 1
        else:
            print('No')
    elif i == 'b':
        if ((A+B-1) >= pass_num)and(pass_fo <= B-1):
            print('Yes')
            pass_num += 1
            pass_fo += 1
        else:
            print('No')
    else:
        print('No')

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
12 66 -1
abcbacaccaba

Expected output:
Yes
No
No
No
Yes
No
Yes
No
No
Yes
No
Yes


Actual output:
Yes
Yes
No
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes


Fixed submission (verdict: Accepted):
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")
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = list(map(int, input().split()))
S = input()
cnt1 = 0
cnt2 = 0
for x in S:
    if x == 'a':
        if cnt1 < A+B:
            print("YES")
            cnt1 += 1
        else:
            print("NO")
    elif x == 'b':
        if cnt1 < A+B and cnt2 < B:
            print("YES")
            cnt1 += 1
            cnt2 += 1
        else:
            print("NO")
    else:
        print("NO")

Failing test case input:
12 2 1
abacbababaac

Expected output:
Yes
Yes
Yes
No
No
No
No
No
No
No
No
No


Actual output:
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO


Fixed submission (verdict: Accepted):
N, A, B = list(map(int, input().split()))
S = input()
cnt1 = 0
cnt2 = 0
for x in S:
    if x == 'a':
        if cnt1 < A+B:
            print("Yes")
            cnt1 += 1
        else:
            print("No")
    elif x == 'b':
        if cnt1 < A+B and cnt2 < B:
            print("Yes")
            cnt1 += 1
            cnt2 += 1
        else:
            print("No")
    else:
        print("No")

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = map(int, input().split())
allr = abrr = 1

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

Failing test case input:
12 1 2
cabbabaacaba

Expected output:
No
Yes
Yes
Yes
No
No
No
No
No
No
No
No


Actual output:
No
Yes
Yes
No
Yes
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
allr = abrr = 1

for i in input():
        if i=="a":
                if allr<=a+b:
                        print("Yes")
                        allr += 1
                else: print("No")
        elif i=="b":
                if allr<=a+b and abrr<=b:
                        print("Yes")
                        allr += 1
                else: print("No")
                abrr += 1
        else: print("No")
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B=map(int,input().split())
s = input().rstrip()
count = 0
countB = 0
for i in range(N):
  if A+B <= count:
    print('No')
  else:
    if s[i] == 'a':
      print('Yes')
      count += 1
    elif s[i] =='b':
      if countB <= B:
        print('Yes')
        countB += 1
        count += 1
      else:
        print('No')
    else:
      print('No')


Failing test case input:
12 6 0
cabbbaaacaba

Expected output:
No
Yes
No
No
No
Yes
Yes
Yes
No
Yes
No
Yes


Actual output:
No
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
No
No


Fixed submission (verdict: Accepted):
N,A,B=map(int,input().split())
s = input().rstrip()
count = 0
countB = 0
for i in range(N):
  if A+B <= count:
    print('No')
  else:
    if s[i] == 'a':
      print('Yes')
      count += 1
    elif s[i] =='b':
      if countB < B:
        print('Yes')
        countB += 1
        count += 1
      else:
        print('No')
    else:
      print('No')

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
s=input()
pa,pb=0,0
for i in range(n):
  if s[i]=='a':
    pa+=1
    if pa+pb<=a+b:
      print('Yes')
    else:
      print('No')
  elif s[i]=='b':
    pb+=1
    if pa+pb<=a+b and pb<=b:
      print('Yes')
    else:
      print('No')
  else:
    print('No')


Failing test case input:
12 5 0
abacaababbac

Expected output:
Yes
No
Yes
No
Yes
Yes
No
Yes
No
No
No
No


Actual output:
Yes
No
Yes
No
Yes
Yes
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
s=input()
pa,pb=0,0
for i in range(n):
  if s[i]=='a':
    if pa+pb<a+b:
      pa+=1
      print('Yes')
    else:
      print('No')
  elif s[i]=='b':
    if pa+pb<a+b and pb<b:
      pb+=1
      print('Yes')
    else:
      print('No')
  else:
    print('No')

Problem: p03971
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
count1 = 0
count2 = 0
N, A, B = map(int, input().split())
S = list(input())
for i in S:
  if i == "a" and A + B >= count1:
    print("Yes")
    count1 += 1
  elif i == "b" and A + B >= count1 and B >= count2:
    print("Yes")
    count1 += 1
    count2 += 1
  else :
    print("No")

Failing test case input:
12 10 1
bacbacaacabb

Expected output:
Yes
Yes
No
No
Yes
No
Yes
Yes
No
Yes
No
No


Actual output:
Yes
Yes
No
Yes
Yes
No
Yes
Yes
No
Yes
No
No


Fixed submission (verdict: Accepted):
count1 = 0
count2 = 0
N, A, B = map(int, input().split())
S = list(input())
for i in S:
  if i == "a" and A + B > count1:
    print("Yes")
    count1 += 1
  elif i == "b" and A + B > count1 and B > count2:
    print("Yes")
    count1 += 1
    count2 += 1
  else :
    print("No")
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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



Failing test case input:
10 2 1
bbaacaccba

Expected output:
Yes
No
Yes
Yes
No
No
No
No
No
No


Actual output:
Yes
Yes
Yes
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
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

Problem: p03971
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,a,b = map(int,input().split())
s = input()
maxa = a+b
maxb = b
counta = 0
countb = 0
for i in range(n):
  if s[i] == 'c':
    print("No")
  elif s[i] == 'b':
    if countb < maxb and counta < maxa:
      print("Yes")
    else:
      print("No")
    counta += 1
    countb += 1
  else:
    if counta < maxa:
      print("Yes")
    else:
      print("No")
    counta+=1

Failing test case input:
10 2 0
abccabaabb

Expected output:
Yes
No
No
No
Yes
No
No
No
No
No


Actual output:
Yes
No
No
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
n,a,b = map(int,input().split())
s = input()
maxa = a+b
maxb = b
counta = 0
countb = 0
for i in range(n):
  if s[i] == 'c':
    print("No")
  elif s[i] == 'b':
    if countb < maxb and counta < maxa:
      print("Yes")
      counta += 1
      countb += 1
    elif counta < maxa:
      print("No")
    else:
      print("No")
  else:
    if counta < maxa:
      print("Yes")
    else:
      print("No")
    counta+=1

Problem: p03971
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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")

Failing test case input:
10 2 3
bbbabaccba

Expected output:
Yes
Yes
Yes
Yes
No
Yes
No
No
No
No


Actual output:
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No


Fixed submission (verdict: Accepted):
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")
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
s=input()
pa,pb=0,0
for i in range(n):
  if s[i]=='a':
    if pa+pb<a+b:
      pa+=1
      print('Yes')
    else:
      print('No')
  elif s[i]=='b':
    if pa+pb<=a+b and pb<=b:
      pb+=1
      print('Yes')
    else:
      print('No')
  else:
    print('No')


Failing test case input:
12 9 0
abacaababbac

Expected output:
Yes
No
Yes
No
Yes
Yes
No
Yes
No
No
Yes
No


Actual output:
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
Yes
No


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
s=input()
pa,pb=0,0
for i in range(n):
  if s[i]=='a':
    if pa+pb<a+b:
      pa+=1
      print('Yes')
    else:
      print('No')
  elif s[i]=='b':
    if pa+pb<a+b and pb<b:
      pb+=1
      print('Yes')
    else:
      print('No')
  else:
    print('No')

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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



Failing test case input:
12 3 -2
aabcbababaac

Expected output:
Yes
No
No
No
No
No
No
No
No
No
No
No


Actual output:
Yes
Yes
No
No
No
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
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

Problem: p03971
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,a,b = map(int, input().split())
s = str(input())
counter1 = counter2 = 0
for char in s:
    if char != "c":
        counter1 += 1
    if char == "b":
        counter2 += 1
    if (counter1 <= (a+b)) & (char == 'a'):
        print("Yes")
    elif (counter1 <= (a+b)) & (char == 'b') & (counter2 <= b):
        print("Yes")
    else:
        print("No")

Failing test case input:
12 2 1
babbabaacaca

Expected output:
Yes
Yes
No
No
Yes
No
No
No
No
No
No
No


Actual output:
Yes
Yes
No
No
No
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
n,a,b = map(int, input().split())
s = str(input())

counter1 = counter2 = 1
for char in s:
    if (counter1 <= (a+b)) & (char == 'a'):
        print("Yes")
        counter1 += 1
    elif (counter1 <= (a+b)) & (char == 'b') & (counter2 <= b):
        print("Yes")
        counter1 += 1
        counter2 += 1
    else:
        print("No")
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
12 3 3
abaccababaac

Expected output:
Yes
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No
No


Actual output:
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
No
No


Fixed submission (verdict: Accepted):
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")

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = map(int,input().split())
s = list(input())
A = 0 
B = 0 

for i in range(n):
    if s[i] == "c":
        print("No")

    elif s[i] == "a" and (A + B) < a + b:
        print("Yes")
        A += 1


    elif s[i] == "b" and (A + B) < a + b and B <= b:
        print("Yes")
        B += 1


    else:
        print("No")



Failing test case input:
12 14 0
caababaccaba

Expected output:
No
Yes
Yes
No
Yes
No
Yes
No
No
Yes
No
Yes


Actual output:
No
Yes
Yes
Yes
Yes
No
Yes
No
No
Yes
No
Yes


Fixed submission (verdict: Accepted):
n,a,b = map(int,input().split())
s = list(input())
A = 0 
B = 0 

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

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
S = list(input())

A_sum = 0
B_sum = 0

for i in S:
        if i == 'a':
                if A_sum + B_sum < A + B:
                        A_sum += 1
                        print('YES')
                else:
                        print('NO')
        elif i == 'b':
                if A_sum + B_sum < A + B and B_sum < B:
                        B_sum += 1
                        print('YES')
                else:
                        print('NO')
        else:
                print('NO')


Failing test case input:
12 8 3
cacbabaacaba

Expected output:
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes


Actual output:
NO
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES


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

A_sum = 0
B_sum = 0

for i in S:
        if i == 'a':
                if A_sum + B_sum < A + B:
                        A_sum += 1
                        print('Yes')
                else:
                        print('No')
        elif i == 'b':
                if A_sum + B_sum < A + B and B_sum < B:
                        B_sum += 1
                        print('Yes')
                else:
                        print('No')
        else:
                print('No')
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int,input().split())
student = input()
passp = 0
passb = 0
for s in student:
	if s == "a" and passp < (A+B):
		passp += 1
		print("YES")
	elif s == "b" and passp < (A+B) and passb < B:
		passp += 1
		passb += 1
		print("YES")
	else:
		print("NO")

Failing test case input:
12 3 0
caababaccaba

Expected output:
No
Yes
Yes
No
Yes
No
No
No
No
No
No
No


Actual output:
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO


Fixed submission (verdict: Accepted):
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")

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
S = input()
passed = []

for i in range(N):
  if S[i] == 'c':
    print('No')
  elif S[i] == 'a':
    if len(passed) <= A+B:
      print('Yes')
      passed.append('a')
    else: print('No')
  else:
    if len(passed) <= A+B and passed.count('b') <= B:
      print('Yes')
      passed.append('b')
    else: print('No')

Failing test case input:
12 2 2
cabbabaacaca

Expected output:
No
Yes
Yes
Yes
Yes
No
No
No
No
No
No
No


Actual output:
No
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
s = input().strip()

sumy = 0
sumf = 0
for _s in s:
  if _s == 'c':
    print('No')
  elif _s == 'a':
    if sumy < a + b:
      print('Yes')
      sumy += 1
    else:
      print('No')
  else:
    if sumy < a + b and sumf < b:
      print('Yes')
      sumy += 1
      sumf += 1
    else:
      print('No')

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = list(map(int,input().split()))

s = input()

for i in s:
    if i == 'c':
        print('no')
    elif i == 'a' and (a+b>=1):
        if a>0:
            a -= 1
        else:
            b -= 1
        print('yes')
    elif i =='b' and b > 0:
        b -= 1
        print('yes')
    else:
        print('no')

Failing test case input:
12 7 1
caabaabccaba

Expected output:
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
No
Yes


Actual output:
no
yes
yes
yes
yes
yes
no
no
no
yes
no
yes


Fixed submission (verdict: Accepted):
n,a,b = list(map(int,input().split()))

s = input()

for i in s:
    if i == 'c':
        print('No')
    elif i == 'a' and (a+b>=1):
        if a>0:
            a -= 1
        else:
            b -= 1
        print('Yes')
    elif i =='b' and b > 0:
        b -= 1
        print('Yes')
    else:
        print('No')
Problem: p03971
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
count1 = 0
count2 = 0
N, A, B = map(int, input().split())
S = list(input())
for i in S:
  if i == "a" and A + B >= count1:
    print("Yes")
    count1 += 1
  elif i == "b" and A + B >= count1 and B > count2:
    print("Yes")
    count1 += 1
    count2 += 1
  else :
    print("No")

Failing test case input:
12 3 -2
aabcbababaac

Expected output:
Yes
No
No
No
No
No
No
No
No
No
No
No


Actual output:
Yes
Yes
No
No
No
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
count1 = 0
count2 = 0
N, A, B = map(int, input().split())
S = list(input())
for i in S:
  if i == "a" and A + B > count1:
    print("Yes")
    count1 += 1
  elif i == "b" and A + B > count1 and B > count2:
    print("Yes")
    count1 += 1
    count2 += 1
  else :
    print("No")

Problem: p03971
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, A, B = map(int, input().split())
S = list(input())

a_pass = 0
b_pass = 0

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

Failing test case input:
12 8 1
abacaababcac

Expected output:
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
Yes
No


Actual output:
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No


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

a_pass = 0
b_pass = 0

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

Problem: p03971
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,a,b=map(int,input().split())
s = input()

cnt_s = 0
cnt_b = 0

for i in range(n):
    if cnt_s <= a+b and i == 'a':
        print('Yes')
        cnt_s += 1
    elif cnt_s > a+b and i == 'a':
        print('No')
    elif cnt_s <= a+b and cnt_b <= b and i =='b':
        print('Yes')
        cnt_b += 1
        cnt_s += 1
    else:
        print('No')
    

Failing test case input:
10 2 2
abccacaabb

Expected output:
Yes
Yes
No
No
Yes
No
Yes
No
No
No


Actual output:
No
No
No
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
s = input()

cnt_s = 0
cnt_b = 0

for i in range(len(s)):
    if s[i] == 'a' and cnt_s < a+b:
        print('Yes')
        cnt_s += 1
    elif s[i] == 'a' and cnt_s > a+b:
        print('No')
    elif s[i] =='b' and cnt_s < a+b and cnt_b < b:
        print('Yes')
        cnt_b += 1
        cnt_s += 1
    else:
        print('No')
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
S = input()
y = 0
k = 0
for i in S:
    if i=='c':
        print('No')
    elif (i=='a'):
        if (y<(A+B)):
            print('Yes')
            y += 1
        else:
            print('No')
    else:
        if (y<(A+B))and(k<=B):
            print('Yes')
            y += 1
            k += 1
        else:
            print('No')

Failing test case input:
10 2 1
bbaacaccba

Expected output:
Yes
No
Yes
Yes
No
No
No
No
No
No


Actual output:
Yes
Yes
Yes
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
S = input()
y = 0
k = 0
for i in S:
    if i=='c':
        print('No')
    elif i=='a':
        if (y<(A+B)):
            print('Yes')
            y += 1
        else:
            print('No')
    else:
        if (y<(A+B))and(k<B):
            print('Yes')
            y += 1
            k += 1
        else:
            print('No')

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
12 2 1
abacbababaac

Expected output:
Yes
Yes
Yes
No
No
No
No
No
No
No
No
No


Actual output:
Yes
Yes
Yes
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
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")

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b = (int(s) for s in input().strip().split(' '))
s = input()
passed = 0
b_passed = 0
for c in range(0,len(s)):
    if s[c] == "a" and passed < a+b:
        passed += 1
        print("yes")
    elif s[c] == "b" and passed < a+b and b_passed < b:
        passed+=1
        b_passed+=1
        print("yes")
    else:
        print("no")

Failing test case input:
10 2 2
abccacaabb

Expected output:
Yes
Yes
No
No
Yes
No
Yes
No
No
No


Actual output:
yes
yes
no
no
yes
no
yes
no
no
no


Fixed submission (verdict: Accepted):
n, a, b = (int(s) for s in input().strip().split(' '))
s = input()
passed = 0
b_passed = 0
for c in range(0,len(s)):
    if s[c] == "a" and passed < a+b:
        passed += 1
        print("Yes")
    elif s[c] == "b" and passed < a+b and b_passed < b:
        passed+=1
        b_passed+=1
        print("Yes")
    else:
        print("No")
Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
s=input()
ca=0
cb=0
for i in range(n):
	if s[i]=="a":
		ca+=1
		if ca+cb<=a+b:
			print("Yes")
			continue
	elif s[i]=="b":
		cb+=1
		if ca+cb<=a+b and cb<=b:
			print("Yes")
			continue
	print("No")

Failing test case input:
12 2 1
babbabaacaca

Expected output:
Yes
Yes
No
No
Yes
No
No
No
No
No
No
No


Actual output:
Yes
Yes
No
No
No
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
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")

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = input().split(' ')
N = int(N)
A = int(A)
B = int(B)
S = []
S = list(input())
print(S)
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') 

Failing test case input:
12 7 2
caababaccbba

Expected output:
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes


Actual output:
['c', 'a', 'a', 'b', 'a', 'b', 'a', 'c', 'c', 'b', 'b', 'a']
No
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes


Fixed submission (verdict: Accepted):
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')

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
S = input()

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

Failing test case input:
12 7 1
caabaabccaba

Expected output:
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
No
Yes


Actual output:
No
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Yes


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
S = input()

cnt = 0
fcnt = 0
for i in range(N):
    s = S[i]
    if s == "c":
        print("No")
        continue
    if cnt < A + B:
        if s == "a":
            cnt += 1
            print("Yes")
        elif s == "b":
            fcnt += 1
            if fcnt <= B:
                cnt += 1
                print("Yes")
            else:
                print("No")
    else:
        print("No")
Problem: p03971
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,a,b=map(int,input().split())
s = input()

cnt_s = 0
cnt_b = 0

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

Failing test case input:
10 2 3
abccababbb

Expected output:
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No


Actual output:
Yes
No
No
No
Yes
No
Yes
No
No
No


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
s = input()

cnt_s = 0
cnt_b = 0

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

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b=map(int,input().split())
s=input()
c=a+b
A=0
B=0
for i in s:
    if A+B<=c:
        if i=="a":
            A+=1
            print("Yes")
        elif i=="b" and B<b:
            B+=1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Failing test case input:
10 0 0
bbaacaccba

Expected output:
No
No
No
No
No
No
No
No
No
No


Actual output:
No
No
Yes
No
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
n,a,b=map(int,input().split())
s=input()
c=a+b
A=0
B=0
for i in s:
    if A+B<c:
        if i=="a":
            A+=1
            print("Yes")
        elif i=="b" and B<b:
            B+=1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Problem: p03971
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")
	elif s == "b" and passp < (A+B) and passb < B:
		passp += 1
		passb += 1
		print("Yes")
	else:
		print("No")

Failing test case input:
12 5 2
cabbabaacaca

Expected output:
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No


Actual output:
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No


Fixed submission (verdict: Accepted):
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")