Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
l = [p[0]]
b =0
for i in range(1,n):
  l.append(min(p[0:i+1]))
for i in range(0,n):
  if p[i] == l[i]:
    b += 1
print(b)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1
c = a[0]
for i in range(1, n):
  if min(c,a[i])== a[i]:
    c = a[i]
    ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
b =0
for i in range(n):
  if p[i] ==min(p[0:i+1]):
    b += 1
print(b)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1
c = a[0]
for i in range(1, n):
  if min(c,a[i])== a[i]:
    c = a[i]
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
print(t+s)

Fixed submission:
s, t = input().split()
print(t + s)
Buggy python submission (verdict: Runtime Error):
a = input()
for i in range(len(1,a+1)):
  if i%2 == 0:
    if a[i] == 'R':
      print('No')
      exit()
  else:
    if a[i] =='L':
      print('No')
      exit()
print('Yes')

Fixed submission:
a = input()
for i in range(1,len(a)+1):
  if i%2 == 0:
    if a[i-1] == 'R':
      print('No')
      exit()
  else:
    if a[i-1] =='L':
      print('No')
      exit()
print('Yes')
Buggy python submission (verdict: Runtime Error):
a = input()
s = input()
if a>= 3200:
  print(s)
else:
  print('red')

Fixed submission:
a = int(input())
s = input()
if a>= 3200:
  print(s)
else:
  print('red')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b =[]
for i in range(n):
  b.append(1/a[n])
c = sum(b)
print(1/c)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b =[]
for i in range(n):
  b.append(1/a[i])
c = sum(b)
print(1/c)
Buggy python submission (verdict: Runtime Error):
k, x = map(int,input().split())
a = []
for i in range(-k+x+1, k+x):
  a.append(i)
print(' '.join(a))

Fixed submission:
k, x = map(int,input().split())
a = []
for i in range(-k+x+1, k+x):
  a.append(str(i))
print(' '.join(a))
Buggy python submission (verdict: Runtime Error):
a = input()
if len(a) ==6:
  print(90909)
elif len(a) == 5:
  print(90909-90000 +int(a)-9999)
elif len(a) == 4:
  print(90909-90000)
elif len(a) ==3:
  print(90909-90000-900b+int(a)-99)
elif len(a) ==2:
  print(90909-90000-900)
else:
  print(int(a))
  

Fixed submission:
a = input()
if len(a) ==6:
  print(90909)
elif len(a) == 5:
  print(90909-90000 +int(a)-9999)
elif len(a) == 4:
  print(90909-90000)
elif len(a) ==3:
  print(90909-90000-900+int(a)-99)
elif len(a) ==2:
  print(90909-90000-900)
else:
  print(int(a))
Buggy python submission (verdict: Runtime Error):
a = int(input())
l = list(map(int, input().split()))
x = l.sorted()
for i in range(a):
  if x[i] ==l[i]:
    b +=1
if b ==2:
  print('YES')
else:
  print('NO')

Fixed submission:
a = int(input())
l = list(map(int, input().split()))
x = sorted(l)
b =0
for i in range(a):
  if x[i] !=l[i]:
    b +=1
if b ==2 or b ==0:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
a, b = int(input())
if a%(1+b) !=0:
  print(a//(1+b)+1)
else:
  print(a//(1+b))

Fixed submission:
a, b = map(int, input().split())
if a%(1+2*b) !=0:
  print(a//(1+2*b)+1)
else:
  print(a//(1+2*b))
Buggy python submission (verdict: Runtime Error):
a, b , c = map(input().split())
print(min(a*b, c))

Fixed submission:
a, b , c = map(int, input().split())
print(min(a*b, c))
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
s = []
for i in N:
  s.append(i+L)
t = abs(s)
del s[t.index(min(s))]
print(sum(s))

Fixed submission:
N, L = map(int, input().split())
s = []
for i in range(N):
  s.append(i+L)
t = list(map(abs, s))
del s[t.index(min(t))]
print(sum(s))
Buggy python submission (verdict: Time Limit Exceeded):
m, n = map(int, input().split())
l = []
for i in range(n):
  a, b = map(int, input().split())
  l.append(set(range(a,b+1)))
if n >= 2:
  for i in range(1,n):
    d = l[0].intersection(l[i])
else:
  d = l[0]
print(len(d))

Fixed submission:
m, n = map(int, input().split())
a, b = map(int, input().split())
for i in range(n-1):
  c, d = map(int, input().split())
  a = max(a,c)
  b = min(b,d)
if b - a >=0 :
  print(b-a +1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
a, b = map(input().split())
c = 0
for i in range(2):
  if a>b:
    c += a
    a -= 1
  else:
    c += b
    b -= 1
print(c)

Fixed submission:
a, b = map(int, input().split())
c = 0
for i in range(2):
  if a>b:
    c += a
    a -= 1
  else:
    c += b
    b -= 1
print(c)
Buggy python submission (verdict: Runtime Error):
a = int(input())
l = list(map(int, input().split()))
for i in range(a):
  if l[i] >= max(l[0:i]):
    c +=1
print(c)

Fixed submission:
a = int(input())
l = list(map(int, input().split()))
c = 1
for i in range(1, a):
  if l[i] >= max(l[:i]):
    c +=1
print(c)
Buggy python submission (verdict: Runtime Error):
a = [input() for x in range(5)]
k = int(input())

if a[4] - a[0] > k:
  print(':(')
else:
  print('Yay!')



Fixed submission:
a = [int(input()) for x in range(5)]
k = int(input())
 
if a[4] - a[0] > k:
  print(':(')
else:
  print('Yay!')
Buggy python submission (verdict: Runtime Error):
a = input()
d = 'Heisei'
if int(a[0:4]) ==2019:
  if int(a[5:7]) == 4:
    if int(a[8:10]) == 30:
      break
    elif int(a[8:10]) <30:
      d = 'TBD'
    else:
      break
  elif int(a[5:7]) <=3:
    d = 'TBD'
  else:
    break
elif int(a[0:4]) <= 2018:
  d = 'TBD'
else:
  break
print(d)

Fixed submission:
a = input()
d = 'TBD'
if int(a[0:4]) ==2019:
  if int(a[5:7]) == 4:
    if int(a[8:10]) <=30:
      d = 'Heisei'
  elif int(a[5:7]) <=3:
    d = 'Heisei'
elif int(a[0:4]) <= 2018:
  d = 'Heisei'
print(d)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
  a, b = map(str, input().split())
  if b = 'JPY':
    ans += int(a)
  else:
    ans += int(a) * 380000
print(ans)


Fixed submission:
n = int(input())
ans = 0
for i in range(n):
  a, b = map(str, input().split())
  if b == 'JPY':
    ans += float(a)
  else:
    ans += float(a) * 380000
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
  a, b = map(int, input().split())
  if b = 'JPY':
    ans += a
  else:
    ans += a * 380000
print(ans)

Fixed submission:
n = int(input())
ans = 0
for i in range(n):
  a, b = map(str, input().split())
  if b == 'JPY':
    ans += float(a)
  else:
    ans += float(a) * 380000
print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
if a = 22:
  print('Christmas Eve Eve Eve')
elif a = 23:
  print('Christmas Eve Eve')
elif a = 24:
  print('Christmas Eve')
else:
  print('Christmas')

Fixed submission:
a = int(input())
if a == 22:
  print('Christmas Eve Eve Eve')
elif a == 23:
  print('Christmas Eve Eve')
elif a == 24:
  print('Christmas Eve')
else:
  print('Christmas')
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = []
for i in range(n):
  p[i]= int(input())
p.sort()
print(p[-1]//2 + sum(p[:-2]))

Fixed submission:
n = int(input())
p = [0] * n
for i in range(n):
  p[i]= int(input())
p.sort()
print(p[-1]//2 + sum(p[:-1]))
Buggy python submission (verdict: Runtime Error):
n, t = map(int, input().split())
ans =[]
for i in range(n):
  a, b = map(int, input().split())
  if b <= t:
    ans.append(a)
print(min(ans))
    

Fixed submission:
n, t = map(int, input().split())
ans =[]
for i in range(n):
  a, b = map(int, input().split())
  if b <= t:
    ans.append(a)
if len(ans) ==0:
  print('TLE')
else:
  print(min(ans))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = []
for i in range(3):
  if a[i] ==1:
  	b.append('9')
  else:
    b.append('1')
print(''.join(b))

Fixed submission:
a = input()
b = []
for i in range(3):
  if a[i] =='1':
  	b.append('9')
  else:
    b.append('1')
print(''.join(b))

Buggy python submission (verdict: Runtime Error):
a = int(input())
for i in range(3):
  if a[i] ==1:
  	a[i] ==9
  else:
    a[i] ==1
print(a)

Fixed submission:
a = input()
b = []
for i in range(3):
  if a[i] =='1':
  	b.append('9')
  else:
    b.append('1')
print(''.join(b))
Buggy python submission (verdict: Runtime Error):
n = input()
for i in range(int(n), 1000):
  if i.count(n[0]) == 3:
    print(i)
    exit()

Fixed submission:
n = input()
for i in range(int(n), 1000):
  if str(i).count(str(i)[0]) == 3:
    print(i)
    exit()
Buggy python submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
a = map(int, input().split())
print(min(sum([1 for i in a if i>x]),sum([1 for i in a if i<x]))

Fixed submission:
n, m, x = map(int, input().split())
a = list(map(int, input().split()))
print(min(sum([1 for i in a if i>x]),sum([1 for i in a if i<x])))
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
l = list(range(a,b+1))
la = l[0:k]
lb = l[-k:]

lc = list(set(la + lb))
lc.sort()
for i in range(len(lc)):
  print(lc[i])

Fixed submission:
4,5,6,7,8,9,10
a, b , k = map(int, input().split())
if k > (b-a)//2:
  for i in range(a, b+1):
    print(i)
else:
  for i in range(a, a+k):
    print(i)
  for j in range(b-k+1,b+1):
    print(j)
Buggy python submission (verdict: Runtime Error):
n = int(input())
k = len(set(map(str, input().split())))
if k = 4:
  print('Four')
else:
  print('Three')


Fixed submission:
n = int(input())
k = len(set(map(str, input().split())))
if k == 4:
  print('Four')
else:
  print('Three')
Buggy python submission (verdict: Runtime Error):
a = input()
a[3] = '8'
print(a)

Fixed submission:
a = input()
a = a.replace('2017','2018')
print(a)
Buggy python submission (verdict: Runtime Error):
import math
print(math.floor(math.sqrt(int(input())))


Fixed submission:
import math
print(math.floor(math.sqrt(int(input())))**2)
Buggy python submission (verdict: Runtime Error):
x, t = map(int, input.split())
if x - t < 0:
  print(0)
else:
  print(x-t)

Fixed submission:
x, t = map(int, input().split())
if x - t < 0:
  print(0)
else:
  print(x-t)
Buggy python submission (verdict: Runtime Error):
x, a, b = map(int, input())
if abs(x-a) > abs(x-b):
  print('B')
else:
  print('A')

Fixed submission:
x, a, b = map(int, input().split())
if abs(x-a) > abs(x-b):
  print('B')
else:
  print('A')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
b = a[0]
c = []
while True:
  if b == 2:
    print(len(c)+1)
    exit()
  elif b in c:
    print(-1)
    exit()
  else:
    c.append(b)
    b = a[c[-1]-1]

Fixed submission:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
b = a[0]
c = []
while True:
  if b == 2:
    print(len(c)+1)
    exit()
  if len(c)> n:
    print(-1)
    exit()
  else:
    c.append(b)
    b = a[c[-1]-1]
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input())
if a + b >= 10:
  print('error')
else:
  print(a+b)


Fixed submission:
a, b = map(int,input().split())
if a + b >= 10:
  print('error')
else:
  print(a+b)

Buggy python submission (verdict: Runtime Error):
a, b = int(input())
if a + b >= 10:
  print('error')
else:
  print(a+b)

Fixed submission:
a, b = map(int,input().split())
if a + b >= 10:
  print('error')
else:
  print(a+b)
Buggy python submission (verdict: Runtime Error):
a, b = map(str, input().split())
if a = 'H':
  print(b)
else:
  if b = 'H':
    print('D')
  else:
    print('H')

Fixed submission:
a, b = map(str, input().split())
if a == 'H':
  print(b)
else:
  if b == 'H':
    print('D')
  else:
    print('H')
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input()))
print(len(set(a)))

Fixed submission:
a = list(map(int, input().split()))
print(len(set(a)))
Buggy python submission (verdict: Runtime Error):
a = input()
al = 'abcdefghijklmnopqrstuvwxyz'
for a in range(26):
  if a.count(al[i]) % 2 != 0:
    print('No')
    exit()
print('Yes')

Fixed submission:
a = str(input())
al = 'abcdefghijklmnopqrstuvwxyz'
for i in range(26):
  if a.count(al[i]) % 2 != 0:
    print('No')
    exit()
print('Yes')
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
sc = []
tf = True
tff = False
for i in range(M):
  sc.append(list(map(int, input().strip().split())))
num = []
for i in range(N):
  num.append(0)
sc.sort()
if N == 1 and sc[0][0] == 1 and sc[0][1] == 0:
  tff = True
for i in range(M-1):
  if sc[i][0] == sc[i+1][0] and sc[i][1] != sc[i+1][1]:
    tf = False
for i in sc:
  if i[0] == 1 and i[1] == 0:
    tf = False
  else:
    num[i[0]-1] = i[1]
if tf and num[0] == 0:
  num[0] = 1
string = ""
for i in num:
  string += str(i)
if tff == True:
  print(0)
elif tf == True:
  print(string)
else:
  print(-1)

Fixed submission:
N, M = map(int, input().split())
sc = []
tf = True
tff = False
for i in range(M):
  sc.append(list(map(int, input().strip().split())))
if len(sc) == 0:
  if N == 1:
    print(0)
  else:
    print("1"+"0"*(N-1))
else:
  num = []
  for i in range(N):
    num.append(0)
  sc.sort()
  if N == 1 and sc[0][0] == 1 and sc[0][1] == 0:
    tff = True
  for i in range(M-1):
    if sc[i][0] == sc[i+1][0] and sc[i][1] != sc[i+1][1]:
      tf = False
  for i in sc:
    if i[0] == 1 and i[1] == 0:
      tf = False
    else:
      num[i[0]-1] = i[1]
  if tf and num[0] == 0:
    num[0] = 1
  string = ""
  for i in num:
    string += str(i)
  if tff == True:
    print(0)
  elif tf == True:
    print(string)
  else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
sc = []
tf = True
for i in range(M):
  sc.append(list(map(int, input().strip().split()))
num = []
for i in range(N):
  num.append(0)
for i in sc:
  if i[0] == N and i[1] == 0:
    tf = False
  else:
    num[i[0]-1] = i[1]
if tf:
  num[0] = 1
string = ""
for i in num:
  string += str(i)
if tf:
  print(string)
else:
  print(-1)

Fixed submission:
N, M = map(int, input().split())
sc = []
tf = True
tff = False
for i in range(M):
  sc.append(list(map(int, input().strip().split())))
if len(sc) == 0:
  if N == 1:
    print(0)
  else:
    print("1"+"0"*(N-1))
else:
  num = []
  for i in range(N):
    num.append(0)
  sc.sort()
  if N == 1 and sc[0][0] == 1 and sc[0][1] == 0:
    tff = True
  for i in range(M-1):
    if sc[i][0] == sc[i+1][0] and sc[i][1] != sc[i+1][1]:
      tf = False
  for i in sc:
    if i[0] == 1 and i[1] == 0:
      tf = False
    else:
      num[i[0]-1] = i[1]
  if tf and num[0] == 0:
    num[0] = 1
  string = ""
  for i in num:
    string += str(i)
  if tff == True:
    print(0)
  elif tf == True:
    print(string)
  else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().strip().split()))
total = 0
points = 0 
for i in X:
  total += i
avg = int(round(total/N))
for i in X:
  points += (a-avg)^^2
print(points)

Fixed submission:
N = int(input())
X = list(map(int, input().strip().split()))
total = 0
points = 0
for i in X:
  total += i
avg = int(round(total/N))
for i in X:
  points += (i-avg)**2
print(points)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1:
  print(((N-1)/2)/((N-1)/2-1))
else:
  print(0.5)

Fixed submission:
N = int(input())
if N%2 == 1:
  print(((N-1)/2+1)/(N))
if N%2 == 0:
  print(0.5)
Buggy python submission (verdict: Runtime Error):
N = input().strip()
N = N + "."
N.strip("0")
N = N[:-1]
total = 0
for i in range(1, len(N), 2):
    total += int("1"+"0"*i) - int("1"+"0"*(i-1))
if len(N) % 2 == 0:
    pass
else:
    total += int(N[1:])+1
print(total)


Fixed submission:
N = input().strip()
N = N + "."  # for removing the leading zeroes just in case
N.strip("0")
N = N[:-1]
total = 0
for i in range(1, len(N), 2):
    total += int("1"+"0"*i) - int("1"+"0"*(i-1))
if len(N) % 2 == 0:
    total += 0
else:
    total += int(N) - (int("1" + "0" * (len(N) - 1))) + 1
print(total)

Buggy python submission (verdict: Runtime Error):
N = input().strip()
total = 0
for i in range(1, len(N), 2):
    total += 10**i - 10**(i-1)
if len(N) % 2 == 0:
    pass
else:
    total += int(N[1:])+1
print(total)

Fixed submission:
N = input().strip()
N = N + "."  # for removing the leading zeroes just in case
N.strip("0")
N = N[:-1]
total = 0
for i in range(1, len(N), 2):
    total += int("1"+"0"*i) - int("1"+"0"*(i-1))
if len(N) % 2 == 0:
    total += 0
else:
    total += int(N) - (int("1" + "0" * (len(N) - 1))) + 1
print(total)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
c=0
for i in range(1,n):
    c+=(i%n)
print(c)

Fixed submission:
n=int(input())
n-=1
a=(n*(n+1))//2
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
c=0
for i in range(1,n):
    c+=(i%n)
print(c)

Fixed submission:
n=int(input())
n-=1
a=(n*(n+1))//2
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
for i in range(1,n):
  a.append(i%n)
print(sum(a))

Fixed submission:
n=int(input())
n-=1
a=(n*(n+1))//2
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
for i in range(1,n):
  a.append(i)
c=0
for i in a:
    c=c+(i%n)
print(c)

Fixed submission:
n=int(input())
n-=1
a=(n*(n+1))//2
print(a)
Buggy python submission (verdict: Runtime Error):
S = input()
if S = "ARC":
    print('ABC')
else:
    print('ARC')

Fixed submission:
S = input()
if S == "ARC":
    print('ABC')
else:
    print('ARC')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(4100000)
input = sys.stdin.readline
N = int(input()) #社員数
joushi_no_bangou = [0] #上司の社員番号
ans = []
joushi_no_bangou += map(int,input().split())

#==--------------

for i in range(N):
    print(joushi_no_bangou.count(i+1))

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
ct = [0] * N
     
for a in As: #ここがキモ．リスト「As」にはそれぞれの上司が入っていて，その中からaを取り出すので，a=上司になっている．これにより，ctの上司を正確に呼び出すことができる．
    ct[a-1] += 1
     
for c in ct:
    print(c)

#別解
#print(*c,sep='\n')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(20000000)
N = int(input()) #社員数
joushi_no_bangou = [0] #上司の社員番号
ans = []
joushi_no_bangou += map(int,input().split())

#==--------------

for i in range(N):
    print(joushi_no_bangou.count(i+1))

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
ct = [0] * N
     
for a in As: #ここがキモ．リスト「As」にはそれぞれの上司が入っていて，その中からaを取り出すので，a=上司になっている．これにより，ctの上司を正確に呼び出すことができる．
    ct[a-1] += 1
     
for c in ct:
    print(c)

#別解
#print(*c,sep='\n')

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input()) #社員数
joushi_no_bangou = [0] #上司の社員番号
ans = []
joushi_no_bangou += map(int,input().split())

#==--------------

for i in range(N):
    print(joushi_no_bangou.count(i+1))

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
ct = [0] * N
     
for a in As: #ここがキモ．リスト「As」にはそれぞれの上司が入っていて，その中からaを取り出すので，a=上司になっている．これにより，ctの上司を正確に呼び出すことができる．
    ct[a-1] += 1
     
for c in ct:
    print(c)

#別解
#print(*c,sep='\n')

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input()) #社員数
joushi_no_bangou = [0] #上司の社員番号
ans = []
joushi_no_bangou += map(int,input().split())

#==--------------

for i in range(N):
    if i+1 not in joushi_no_bangou:
        print(0)
    else:
        print(joushi_no_bangou.count(i+1))

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
ct = [0] * N
     
for a in As: #ここがキモ．リスト「As」にはそれぞれの上司が入っていて，その中からaを取り出すので，a=上司になっている．これにより，ctの上司を正確に呼び出すことができる．
    ct[a-1] += 1
     
for c in ct:
    print(c)

#別解
#print(*c,sep='\n')

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input()) #社員数
joushi_no_bangou = [0] #上司の社員番号
ans = []
joushi_no_bangou += map(int,input().split())

#==--------------

for i in range(N):
    if i+1 not in joushi_no_bangou:
        ans.insert(i,0)
    else:
        ans.insert(i,joushi_no_bangou.count(i+1))
for i in range(N):
    print(ans[i])

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
ct = [0] * N
     
for a in As: #ここがキモ．リスト「As」にはそれぞれの上司が入っていて，その中からaを取り出すので，a=上司になっている．これにより，ctの上司を正確に呼び出すことができる．
    ct[a-1] += 1
     
for c in ct:
    print(c)

#別解
#print(*c,sep='\n')
Buggy python submission (verdict: Time Limit Exceeded):
import re
N,A,B = map(int,input().split())
S = input()
motoplayers = []
cnt = 0
for i in S:
    motoplayers.append(i + str(cnt))
    cnt+=1
players = [i for i in motoplayers if not "c" in i]

kaigai = [i for i in players if "b" in i]
del kaigai[B:]
tuukaninzuu = 0
for i in range(N):
    if motoplayers[i] in players:
        if tuukaninzuu < A+B:
            if "b" in motoplayers[i]:
                if motoplayers[i] in kaigai:
                    print("Yes")
                    tuukaninzuu+=1
                    continue
                else:
                    print("No")
                    continue
            else:
                print("Yes")
                tuukaninzuu+=1
                continue
        else:
            print("No")
            continue
    else:
        print("No")
        continue



Fixed submission:
N,A,B = map(int,input().split())
players = list(input())
tuuka = 0
kaigai = 0
for i in players:
    if i == "c":
        print("No")
        continue
    if i == "b" or i == "a":
        if tuuka < A + B:
            if i == "a":
                print("Yes")
                tuuka += 1
                continue
            if i == "b" and kaigai < B:
                print("Yes")
                tuuka += 1
                kaigai += 1
            else:
                print("No")
        else:
            print("No")
Buggy python submission (verdict: Runtime Error):
a=input()
max=[]
for i in range(3):
  if a[i]== 'R':
    if i ==0:
      max[0]=1
    else:
      max[i]=max[i-1]+1
  else:
    max[i]=0
print(sum(max))
  

Fixed submission:
a=input()
f=[0]*3
for i in range(3):
  if a[i]== 'R':
    if i ==0:
      f[0]=1
    else:
      f[i]=f[i-1]+1
  else:
    f[i]=0
print(max(f))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
if ans > 1000000000000000000:
    print(-1)
else:
    print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > 1000000000000000000:
        print(-1)
        exit(0)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

cnt = 0
before_hairetsu = [N+1] * N

#i_before = N + 1
before_hairetsu[0] = N + 1
for i in range(N):
  if(min( min(before_hairetsu) , P[i]) >= P[i]):
    cnt += 1
  #i_before = P[i]
  before_hairetsu.append( P[i] )
  
print(cnt)
      

Fixed submission:
N = int(input())
P = list(map(int, input().split()))

cnt = 0

maxmax = max(P) + 1

for i in range(N):
  if( maxmax > P[i]):
    cnt += 1
    maxmax = P[i]
  
print(cnt)