peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
l = list(map(int,input().split()))
N = l[0]
Y = l[1]

S = 0
man = 0
gosen = 0
sen = 0

for i in range(1):
    while S <= Y-10000:
        S = S + 10000
        man += 1
    
    while S <= Y-5000:
        S = S + 5000
        gosen += 1
    
    while S <= Y-1000:
        S = S + 1000
        sen += 1       

    if man + gosen +sen > N:
        print("-1 -1 -1")
        break
    
    else:
        print(man,gosen,sen)
# Judge status: Wrong Answer
n = int(input())

while n < 1000:
  n //= 1000

print(n)
# Judge status: Accepted
from heapq import heappop, heappush, heapify
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N = int(readline())
  A = list(x for x in map(int, readline().split()))
  heapify(A)
  Alice = 0
  Bob = 0
  for i in range(N):
    if i%2==0:
      Alice += heappop(A)
    else:
      Bob += heappop(A)
  ans = abs(Alice-Bob)
  print(ans)
  
  
if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
# C - 100 to 105
# https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_c

x = int(input())
d, m = divmod(x, 100)

D = [0] * 5

for i in range(4, -1, -1):
  D[i], m = divmod(m, i + 1)

print(D)

if d >= sum(D):
  print(1)
else:
  print(0)
# Judge status: Accepted
import sys
input = sys.stdin.readline

A = input().rstrip('\n')

N = A.count("N")
S = A.count("S")
W = A.count("W")
E = A.count("E")

if (N == 0 or S == 0) and N + S != 0:
    print("No")
    exit()
if (W == 0 or E == 0) and W + E != 0:
    print("No")
    exit()
print("Yes")
# Judge status: Accepted
a,b,n=map(int,input().split())
x=min(b-1,n)
print((a*x)//b-a*(x//b))
# Judge status: Accepted
n, k = map(int, input().split())

ans = 0
for i in range(1, n + 1):
  c = 0
  while i < k:
    i *= 2
    c += 1
  ans += 1 / n * (1 / 2) ** c
  
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
p = [(int(x)+1)/2 for x in input().split()]
cm = [0]
for n in p:
    cm.append(cm[-1]+n)
ans = 0
for n in range(N-K+1):
    ans = max(cm[n+K]-cm[n],ans)
print(ans)
# Judge status: Wrong Answer
N,Y = map(int,input().split())
A,B,C = 0,0,0
flag = False
for i in range(N):
    if flag:
        break
    for j in range(N):
        if i*10000 + j*5000 + (N-i-j)*1000 == Y and (N-i-j) >= 0:
            A,B,C = i,j,(N-i-j)
            flag = True
            break
if A == B == C == 0:
    A,B,C = -1,-1,-1
print(A,B,C)
# Judge status: Wrong Answer
N = int(input())
N_List = sorted(list(map(int,input().split())))
std = int(N/2)
ansstd = N_List[std] - N_List[std-1] 
print((0,ansstd-1)[ansstd > 1])
# Judge status: Accepted
N, K = map(int, input().split())
sunukes = {i for i in range(1,N+1)}

for _ in range(K):
    d = int(input())
    sunukes_having = set(map(int, input().split()))
    sunukes -= sunukes_having

print(len(sunukes))
# Judge status: Wrong Answer
S = input()
for i in range(len(S)):
  print('x')
# Judge status: Accepted
n,k = map(int,input().split())
s = input()
print(min(sum([1 for i in range(n-1) if s[i] == s[i+1]])+k*2,n-1))
# Judge status: Accepted
l,r,d=map(int,input().split())
print(r//d-(l-1)//d)
# Judge status: Accepted
from collections import defaultdict
n = int(input())

a = list(map(int, input().split()))
ri = defaultdict(lambda: 0)
lj = defaultdict(lambda: 0)

ret = 0
for i in range(n):
	ri[a[i]+i]+=1
	lj[i-a[i]]+=1

for k in ri:
	if(lj[k] >= 1):
		ret+=ri[k]*lj[k]
	
#print(ri)
#print(lj)
print(ret)
# Judge status: Accepted
n, a, b = map(int, input().split())
s = input()

i = 0
j = 0
for n in s:
  if n == "a":
    if i + j < a + b:
      i += 1
      print("Yes")
    else:
      print("No")
  elif n == "b":
    if (i + j < a + b) and j < b:
      j += 1
      print("Yes")
    else:
      print("No")
  else:
    print("No")
# Judge status: Accepted
d,n=map(int,input().split())
if d==0:
  if n==100:
    ans=101
  else:
    ans=n
elif d==1:
  if n==100:
    ans=10100
  else:
    ans=n*100
else:
  if n==100:
    ans=1010000
  else:
    ans=n*10000
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
x = b - a
y = c - b
if x == y:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
# -*- coding: utf-8 -*-


def main():
    import sys
    input = sys.stdin.readline

    x = list(map(int, input().split()))

    for index, xi in enumerate(x, 1):
        if xi == 0:
            print(index)
            exit()


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
def main():
    n,k=map(int,input().split())
    ans=n**2
    ans-=n*(k)
    for i in range(k+1,n+1):
        temp=n//i
        temp*=k
        temp+=min(n%i,k-1)
        #print(ans)
        ans-=temp 
    print(ans)
    

main()
# Judge status: Wrong Answer
n=int(input())
c=1
x=input()
for i in range(n-1):
    if x!=input():
        c+=1
print(c)
# Judge status: Wrong Answer
n = int(input())

if n%2==1:
    print(0)
    exit()

import math

cnt=0
num=10
while True:
    cnt+=math.floor(n/num)
    num *= 5

    if num > n:
        break

print(cnt)
# Judge status: Accepted
from bisect import bisect_left,bisect

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

def is_ok(arg):
  L = bisect(A, arg)
  cnt = 0
  for i in range(L, N):
    p, q = divmod(A[i], arg)
    if q == 0:
      cnt += p-1
    else:
      cnt += p
  return cnt <= K

ng = 0
ok = max(A) + 1

def m_bisect(ng, ok):
  while (abs(ok - ng) > 1):
    mid = (ok + ng) // 2
    if is_ok(mid):
      ok = mid
    else:
      ng = mid
  return ok

print(m_bisect(ng, ok))
# Judge status: Accepted
a,b=map(int,input().split())

lis=[2*a-1,a+b,2*b-1]
print(max(lis))
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = list(map(int, input().split()))

a.sort()

count = 0
num_count = 1
num_count_list = list()
for i in range(1, n):
    if(a[i] == a[i - 1]):
        num_count += 1
    else:
        num_count_list.append(num_count)
        num_count = 1
        count += 1

num_count_list.append(num_count)
if(num_count == 1):
    count += 1

num_count_list.sort()
result = 0
if(count > k):
    loop = count - k

    for i in range(loop):
        result += num_count_list[i]

print(result)
# Judge status: Accepted
def solve():
    N = int(input())
    A = [int(i) for i in input().split()]

    set_A = set([])
    for num in A:
        if num in set_A:
            print('NO')
            return
        set_A.add(num)
    print('YES')

if __name__ == "__main__":
    solve()
# Judge status: Wrong Answer
s=input()
if s[-1]==s:
    print(s+"s")


elif s[-1]!=s:
    print(s+"s")
# Judge status: Accepted
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

X, Y = MI()

print(X + Y // 2)
# Judge status: Accepted
N, *A = map(int, open(0).read().split())
cnt1 = cnt2 = cnt4 = 0
for a in A:
    if a % 4 == 0:
        cnt4 += 1
    elif a % 2 == 0:
        cnt2 += 1
    else:
        cnt1 += 1

if cnt4 >= cnt1:
    print('Yes')
elif cnt4 == cnt1-1 and cnt2 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
D_list = list(map(int, input().split()))
if D_list[0]:
    print(0)
    exit()

branchs = [0] * N
MOD = 998244353

for d in D_list:
    branchs[d] += 1

if branchs[0] != 1:
    print(0)
    exit()

cnt = 1
for v1,v2 in zip(branchs, branchs[1:]):
    cnt *= v1**v2 % MOD
    
print(cnt%MOD)
# Judge status: Accepted
from collections import defaultdict

N, K = map(int, input().split())

A = list(map(int, input().split()))

visited = [0] * N

current = 0
i = 1
while i <= K:
    current = A[current] - 1
    if visited[current] == 0:
        visited[current] = i
    else:
        loop = i - visited[current]
        num_loop = (K - i) // loop
        i += loop * num_loop

    i += 1

ans = current + 1
print(ans)
# Judge status: Accepted
def solve(string):
    n, r = map(int, string.split())
    return str(r + max(10 - n, 0) * 100)


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
# Judge status: Accepted
'''Swap the integer in each box'''
A, B, C = [int(i) for i in input("").split()]
New = A
A = B
B = New
New1 = A
A = C
C = New1
print(A, B, C)
# Judge status: Accepted
def main():
    N = int(input())
    A = list(map(int, input().split()))
    cnt = 0
    for i in range(N):
        if i%2==0 and A[i]%2==1:
            cnt += 1

    print(cnt)



if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
sort_list = list(map(int, input().split()))
if sort_list.count(5) == 1 and sort_list.count(7) == 2:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
s = input()
if s.count('5') == 2 and s.count('7') == 1:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
import sys

s = sys.stdin.readline().strip()
t = sys.stdin.readline().strip()

if sorted(s) < sorted(t, reverse=True):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
x = 10 ** 9 + 7
print(((10 ** N) % x - (2 * (9 ** N)) % x + (8 ** N) % x) % x)
# Judge status: Accepted
def petrozavodsk001_b():
    _ = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    act = sum(B) - sum(A)
    if act < 0:
        print('No')
        return

    addA, addB = 0, 0
    for a, b in zip(A, B):
        if a > b: addB += a - b
        else: addA += (b - a + 1) // 2

    if addA <= act and addB <= act:
        print('Yes')
    else:
        print('No')

petrozavodsk001_b()
# Judge status: Wrong Answer
x, n = map(int, input().split())

if n == 0:
    # input()
    print(x)
else:
    l = list(map(int, input().split()))
    l.sort()
    small = x
    large = x
    while small in l and large in l:
        small -= 1
        large += 1
    if x - small > large - x:
        print(large)
    else:
        print(small)
# Judge status: Wrong Answer
x,y,z = input().split()
print(y,z,x)
# Judge status: Wrong Answer
n,m=map(int,input().split())

x=(4*n-m)/2
y=n-x
ans = x+y


if ans==n:
  print('Yes')
else:
  ('No')
# Judge status: Wrong Answer
k,x = input().split(" ")


text = "No"
 
if k*500>=x:
  text = "Yes"
  
print(text)
# Judge status: Accepted
x=input()
if x =="ABC":
    print("ARC")
else:
    print("ABC")
# Judge status: Wrong Answer
n,m = list(map(int,input().strip().split()))

# 2次元配列
student = []
for i in range(n):
    array = list(map(int, input().strip().split()))
    student.append(array)

cp = []
for i in range(m):
    array = list(map(int, input().strip().split()))
    cp.append(array)

result = [0] * n
for i in range(n):
  dis_min = 10**9
  for j in range(m):
    dis = abs(student[i][0]-cp[j][0]) + abs(student[i][1] - cp[j][1])
    if dis <= dis_min:
      dis_min = dis
      result[i] = j+1

for i in result:
  print(i)
# Judge status: Wrong Answer
s=input()
res=1000
for i in range(3,len(s)):
    res=min(res,abs(753-int(s[i-3:i])))

print(res)
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))

dp = [999999]*(n+1)
dp[0] = 0
dp[1] = 0
dp[2] = abs(h[1]-h[0])

for i in range(3,n+1):
	dp[i] = min(dp[i-1] + abs(h[i-1]-h[i-2]),
	 		dp[i-2] +abs(h[i-1] - h[i-3]))

print(dp[n])
# Judge status: Wrong Answer
s = list(input())

n = int(len(s)/2)
c = 0

if len(s) >= 2:
  if s[1] == s[0]:
    c +=1
    if s[0] == 0:
      s[1] = 1
    elif s[0] == 1:
      s[1] = 0

for i in range(n):
  if s[0] != s[2*i]:
    c += 1
  if s[1] != s[2*i+1]:
    c += 1

print(c)
# Judge status: Accepted
s = input()

tenki = ["Sunny", "Cloudy", "Rainy"]
i = tenki.index(s)
i = (i+1)%3
print(tenki[i])
# Judge status: Accepted
n=input()
l=len(n)
h="Yes"
for i in range(0,len(n)):
    if (i+1)%2!=0:
        if n[i]=="R"or n[i]=="U"or n[i]=="D" :
            pass
        else:
            h="No"
            break
    else:
        if n[i]=="L"or n[i]=="U"or n[i]=="D" :
            pass
        else:
            h="No"
            break
print(h)
# Judge status: Accepted
n, m = list(map(int, input().split()))
broken = [0] * (n + 1)
for _ in range(m):
    broken[int(input())] = 1
mod = 1000000007
dp = [0] * (n + 2)
dp[n] = 1
for i in range(n - 1, -1, -1):
    if broken[i]:
        dp[i] = 0
    else:
        dp[i] = dp[i + 1] + dp[i + 2]
        dp[i] = dp[i] % mod
print(dp[0])
# Judge status: Accepted
S = input()
#print(S,len(S))
if S[len(S)-1] == 's':
    print(S+'es')
else:
    print(S+'s')
# Judge status: Accepted
import bisect


n = int(input())
l = list(map(int,input().split()))


l.sort()
c = 0
for i in range(n)[::-1]:
    for j in range(i)[::-1]:
        d = l[i] - l[j]
        idx = bisect.bisect_right(l,d)
        c += max(0,j-idx)
print(c)
# Judge status: Accepted
from collections import deque
 
n = int(input())
a = list(map(int,input().split()))
d = deque(a)
 
tmp = []
cnt = 0
while d:
  v = d.popleft()
  if len(tmp)<=1:
    pass
  else:
    if not (v >= tmp[-1] >= tmp[-2] >= tmp[0] or v <= tmp[-1] <= tmp[-2] <= tmp[0]):
      tmp = []
      cnt += 1
  tmp.append(v)
#  print(d,tmp,cnt)
if tmp:
  cnt+=1
print(cnt)
# Judge status: Accepted
k,x = (int(x) for x in input().split())
if 500*k >= x:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
from collections import Counter

N = int(input())
s_list = list()
for _ in range(N):
    s_list.append(''.join(sorted(input())))
    
count = 0
for k, v in Counter(s_list).items():
    count += v - 1

print(count)
# Judge status: Accepted
k, a, b = map(int, input().split())
n = min(a - 1, k) + 1
k -= (n - 1)
if a + 2 <= b:
    n += (k // 2) * (b - a)
    n += k % 2
else:
    n += k
print(n)
# Judge status: Accepted
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    absA = list(map(abs, A))
    negcnt = 0
    for a in A:
        if a < 0:
            negcnt += 1
    if 0 in A or negcnt%2==0:
        print(sum(absA))
    else:
        print(sum(absA)-2*min(absA))



if '__main__' == __name__:
    resolve()
# Judge status: Accepted
# -*- coding:utf-8 -*-
import sys,math,statistics
input = sys.stdin.readline
n = int(input())
a = [int(_) for _ in input().split()]
c1 = math.floor(statistics.mean(a))
c2 = math.ceil(statistics.mean(a))
a1 = sum([(i-c1)**2 for i in a])
a2 = sum([(i-c2)**2 for i in a])
print(min(a1,a2))
# Judge status: Accepted
# import numpy as np
# import math
import sys
input = sys.stdin.readline


def main():
    a,b,x = map(int,input().split())

    res = b // x - (a - 1) // x

    print(res)



main()
# Judge status: Accepted
n = int(input())
a = int(input())
r = n%500
if a>=r:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n = list(input())
n = [int(n[i]) for i in range(len(n))]
m = set(n[1:])
if m == {9}:
    print(sum(n[1:]) + n[0])
    exit()
elif m == {}:
    print(n[0])
    exit()
else:
    print(9*(len(n)-1) + n[0] -1)
# Judge status: Wrong Answer
N = int(input())
X = list(map(int,input().split()))
for i in range(N):
  if i < N//2-1:
    print(X[(N)//2])
  elif i == N//2:
    print(X[(N)//2-1])
  elif i == N//2-1:
    print(X[(N)//2])
  elif i > N//2:
    print(X[(N)//2-1])
# Judge status: Accepted
import bisect
n = int(input())
a = []
b = []

for i in range(n):
    m, p = map(int, input().split())
    a.append(m)
    b.append(p)
a.sort()
b.sort()
middle = n // 2
if n % 2:
    print(b[middle] - a[middle] + 1)
else: 
    a_m = ( a[middle] + a[middle - 1] ) / 2
    b_m = ( b[middle] + b[middle - 1] ) / 2
    print(int((b_m - a_m) * 2 + 1))
# Judge status: Accepted
n=int(input())
h=list(map(int,input().split()))

dp=[0]
dp.append(abs(h[1]-h[0]))

for i in range(2,n):
    step1=dp[i-1]+abs(h[i]-h[i-1])
    step2=dp[i-2]+abs(h[i]-h[i-2])
    dp.append(min(step1,step2))
print(dp[-1])
# Judge status: Accepted
a,b,c=map(int,input().split())
if b-a==c-b: print("YES")
else: print("NO")
# Judge status: Wrong Answer
n,*a=map(int,open(0).read().split())
u=d=z=0
for i,j in zip(a[:n],a[n:]):
    if j-i>0:u+=j-i
    elif j-i==0:z+=1
    else:d+=j-i
print("Yes" if u+2*d>=0 else "No")
# Judge status: Accepted
n,k = map(int, input().split())
p = list(map(int, input().split()))
m = sum(p[:k])
q = m
for i in range(n - k):
    q = q - p[i] + p[i + k]
    if q > m:
        m = q

print((k + m) / 2)
# Judge status: Accepted
a, b = map(int, input().split())
c = list(map(int,input().split()))

x = [(e + 1) / 2 for e in c]

t = sum(x[0:b])
res = t
for i in range(a - b):
  t -= x[i]
  t += x[i+b]
  res = max(res,t)

print('{:.12f}'.format(res))
# Judge status: Accepted
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
print(min(N*X, (N-K)*Y+K*X))
# Judge status: Accepted
N, M, Q = map(int, input().split())  #数字
Q = [list(map(int, input().split())) for i in range(Q)]  #数字複数列、複数行

import itertools
A = 0
for i in itertools.combinations_with_replacement(range(M),N):
    score = 0
    for j in range(len(Q)):
        if i[Q[j][1]-1] - i[Q[j][0]-1] == Q[j][2]:
            score += Q[j][3]
        if score > A:
            A = score

print(A)
# Judge status: Accepted
S=input()
ans=True
for i in range(0, len(S)):
    if i%2==1 and S[i]=='R':
        ans=False
    elif i%2==0 and S[i]=='L':
        ans=False
print("Yes" if ans else "No")
# Judge status: Accepted
from decimal import Decimal
a, b = map(Decimal, input().split())
print(a * b //1)
# Judge status: Wrong Answer
s = input()


def solve(query):
    while 1:
        for frag in ("erase", "eraser", "dream", "dreamer"):
            if query.endswith(frag):
                query = query[:-len(frag)]
                print("cut", frag)
                break
        else:
            print("NO", query)
            break
        if not query:
            print("YES")
            break



solve(s)
# Judge status: Accepted
nl = list(input())


# 繰り上げと繰り下げ
dp = [[0, 10000] for i in range(len(nl) + 1)]

for i, n in enumerate(nl[::-1]):
    n = int(n)
    dp[i+1][0] = min(dp[i][0] + n, dp[i][1] + n + 1)
    dp[i+1][1] = min(10 - n + dp[i][0], 10 - n - 1 + dp[i][1])



print(min(dp[-1][0], dp[-1][1]+1))
# Judge status: Wrong Answer
c = raw_input()
if c == 'a' or 'e' or 'i' or 'e' or 'u':
    print "vowel"
else:
    print "consonant"
# Judge status: Wrong Answer
n=int(input())
ans=int((n-1)*n/2)
print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())
route_lists = [input().split() for i in range(m)]
new_lists = []
for i in route_lists:
  for j in range(2):
    new_lists.append(i[j])

new_lists.sort()
sets = set(new_lists)
num_lists = list(sets)
num_lists.sort()
for i in num_lists:
  print(new_lists.count(i))
# Judge status: Accepted
n = int(input())
s = [int(input()) for i in range(n)]

a = sorted(s,reverse=True)
M = a[0]

for i in range(n):
    if s[i] == M:
        print(a[1])
    else:
        print(a[0])
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

sum1=0
sum2=0

for i,j in zip(a,b):
  if i>j:
    sum1+=(i-j)
  elif i<j:
    sum2+=(j-i)//2

print('Yes' if sum1<=sum2 else 'No')
# Judge status: Wrong Answer
a, b = map(str, input().split())
a = int(a)
b = int(float(b) //0.01)

print(int(a*b)//100)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=0
mai=0
for i in range(n):
    if a[i]<0:
        mai+=1
for i in range(n):
    if i==0 or i==n-1:
        continue
    if a[i]<0:
        a[i]=-a[i]
    ans+=a[i]
dif=min(a[0],a[n-1])
dim=max(a[0],a[n-1])
if mai%2==0:
    print(max(ans-dif-dim,ans+dif+dim))
else:
    print(max(ans+dif-dim,ans-dif+dim))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

count = 0

for i in range(N):
    if B[i] > A[i] + A[i+1]:
        count += A[i] + A[i+1]
        A[i+1] = 0
    else:
        count += B[i]

print(count)
# Judge status: Accepted
a,b=[input() for i in range(2)]
p=0
ans=0

for i in b:
  if i =='I':
    p+=1
  elif i =='D' and p>0:
    p-=1
  else:
    p-=1
  
  if ans<p:
    ans=p
 
print(ans)
# Judge status: Accepted
S = input()
T = input()
N = len(S)

dict_S = {}
dict_T = {}

for i in range(N):
    # print("dict_S: {}".format(dict_S))
    # print("dict_T: {}".format(dict_T))
    if S[i] in dict_S:
        if dict_S[S[i]] != T[i]:
            print("No")
            exit()
    if T[i] in dict_T:
        if dict_T[T[i]] != S[i]:
            print("No")
            exit()
    dict_S[S[i]] = T[i]
    dict_T[T[i]] = S[i]
print("Yes")
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=a[1:]
for i in range(n-1):
  x=list(map(int,input().split()))
  x=x[1:]
  for j in a:
    if j not in x:
      a.remove(j)
print(len(a))
# Judge status: Accepted
n, a, b = list(map(int, input().split()))
s = input()


qualified = 0
qualified_oversea = 0
for i, symbol in enumerate(s):
	if symbol == 'c':
		print("No")
	elif symbol == 'a':
		if qualified < a + b:
			print("Yes")
			qualified += 1
		else:
			print("No")
	elif symbol == 'b':
		if qualified < a + b and qualified_oversea < b:
			print("Yes")
			qualified += 1
			qualified_oversea += 1
		else:
			print("No")
# Judge status: Accepted
n, a, b = map(int, input().split())
mod = 10**9+7
c = pow(2,n,mod)
def nCr(n, r, mod):
	r = min(r, n-r)
	numer = denom = 1
	for i in range(1, r+1):
		numer = numer * (n+1-i) % mod
		denom = denom * i % mod
	return numer * pow(denom, mod-2, mod) % mod
c -= 1
aa = nCr(n,a,mod)
bb = nCr(n,b,mod)
c -= (aa+bb)
print (c%mod)
# Judge status: Accepted
import sys
import fractions
def lcm(a, b):
    return abs(a*b) // fractions.gcd(a, b)
n,m=map(int,input().split())
a=list(map(int,input().split()))
c=2
while a[0]%c==0:
  c=c*2
c=c//2
fail=0
for i in range(n):
  if a[i]%c!=0:
    fail=1
  if a[i]%(2*c)==0:
    fail=1
if fail==1:
  print(0)
  sys.exit()
A=1
for i in range(n):
  A=lcm(A,a[i])
print(2*m//A-2*m//(2*A))
# Judge status: Accepted
n,k=map(int,input().split())
d=set(input().split())

while True:
  if len(set(str(n))&d) != 0:
    n+=1
    
  else:
    print(n)
    break
# Judge status: Wrong Answer
import numpy as np
N = int(input())
A = np.array(input().split(), dtype = np.int32)

print(A)
counter = np.bincount(A)
B = counter.copy()
B[1:] += counter[:-1]
B[:-1] += counter[1:]

ans = B.max()
print(ans)
# Judge status: Accepted
s = input()
print(s[:3]+"8"+s[4:])
# Judge status: Wrong Answer
n = int(input())
s = input()
right_w = 0
right_E = 0
left_E = 0
left_W = 0
ans = len(s)
for i in s:
    if i == "W":
        right_w += 1
    else:
        right_E += 1
for i in range(len(s)):
    tmp = s[i]
    tmp_ans = left_W+ right_E
    if tmp_ans < ans:
        ans = tmp_ans
    if tmp == 'W':
        right_w -= 1
        left_W += 1
    else:
        right_E -= 1
        left_E += 1
print(ans)
# Judge status: Accepted

if __name__ == '__main__':
    n = int(input())
    x = list(map(int, input().split()))
    p = []

    for i in range(100):
        cnt = 0
        for j in range(n):
            cnt = cnt + (x[j]-i)**2
        p.append(cnt)

    print(sorted(p)[0])
# Judge status: Wrong Answer
x = input()

X = x.upper()

if x == X:
  print('A')
else:
  print('B')
# Judge status: Accepted
s = str(input())
t = str(input())
count=0
for i in range(len(s)):
  if s[i] != t[i]:
    count+=1
print(count)
# Judge status: Accepted
import sys
input = sys.stdin.readline

n = int(input())
L = [list(map(int,input().split())) for i in range(n)]
A= []

for i in range(n):
    A.append([L[i][0]-L[i][1], L[i][0]+L[i][1]])
A.sort(key=lambda x:x[1])

m = -float("inf")
ans = 0
for i in range(n):
    if m > A[i][0]:
        ans += 1
    else:
        m = A[i][1]
print(n-ans)
# Judge status: Accepted
N=int(input())
for i in (64,32,16,8,4,2,1):
    if i <= N:
        print(i)
        break
# Judge status: Accepted
n, m = map(int, input().split())
a = [1]*n
ans_box = [False]*n
ans_box[0] = True
for _ in range(m):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    a[x] -= 1
    a[y] += 1
    if ans_box[x]:
        if a[x] == 0:
            ans_box[x] = False
        ans_box[y] = True
print(ans_box.count(True))
# Judge status: Accepted
n = int(input())
s = input()

if n < 3200:
  s = 'red'
  
print(s)
# Judge status: Wrong Answer
A,B,C,K = map(int,input().split())

print( ((-1)**(K-1))*(B-A) )
# Judge status: Accepted
a,b,c = map(int,input().split())
a,b = b,a
a,c = c,a
print(a,b,c)