peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

K, A, B = mapint()
if (B-A)/2<=1:
    print(K+1)
else:
    cnt = A
    rest = K - cnt + 1
    if rest<2:
        print(K+1)
    else:
        if rest%2==0:
            print(cnt+(B-A)*rest//2)
        else:
            rest -= 1
            cnt += 1
            print(cnt+(B-A)*rest//2)
# Judge status: Accepted
#a値段,b本数
#n軒,m本
n,m = list(map(int, input().split()))

ab_list = [list(map(int, input().split())) for _ in range(n)]
#print(ab_list)
ab_list.sort()
ans = 0
num = 0
for ab in ab_list:
    ans += ab[0]*ab[1]
    num += ab[1]
    if num >= m:
        i_stop=ab_list.index(ab)
        break
diff_num = num - m
ans -= diff_num * ab_list[i_stop][0]
print(ans)
# Judge status: Accepted
import math
N,D = map(int,input().split())
X = [list(map(int,input().split())) for _ in range(N)]
cnt = 0
for i in range(N-1):
    for j in range(i+1,N):
        distance = 0
        for d in range(D):
            distance += (X[i][d]-X[j][d])**2
        distance = math.sqrt(distance)
        if(distance == int(distance)):
            cnt += 1
print(cnt)
# Judge status: Accepted
import math
H, A = map(int, input().split())
 
# H/A の切り上げ
# ceil or (H+A−1)/A の切り捨て
print((H+A-1) // A)
# Judge status: Accepted
N = int(input())
S = input()
print("Yes" if S[:N//2] == S[N//2:] else "No")
# Judge status: Accepted
S = input()

l = len(S)
x = [0]*(l+1)
y = [0]*(l+1)
for i in range(l):
    if S[i] == "<":
        x[i+1] = x[i]+1
for i in range(l):
    if S[l-i-1] == ">":
        y[l-i-1] = y[l-i]+1

res = 0
for a, b in zip(x, y):
    res += max(a, b)

print(res)
# Judge status: Wrong Answer
import sys
import itertools
import copy
from collections import defaultdict

input = sys.stdin.readline

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

n = I()
mylist = [0 for i in range(8)]
mylist2 = MI()
num = 0

for i in mylist2:
    temp = i // 400
    if temp <= 7:
        mylist[temp] = 1
    else:
        num += 1
        
max = sum(mylist) + num
if max >= 9:
    max = 8

min = sum(mylist)
if min == 0:
    min = 1
    
print(str(min)+ " "+ str(max))
# Judge status: Accepted
# -*- coding: utf-8 -*-

def main():
    t = int(input())
    if t >= 30:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(200000)
 
n = int(input())
 
h = [int(i) for i in input().split()]

d = {}
 
def dp(cost, p):
  if p in d:
    return d[p]
  if p == n-1:
    return cost
  if p < n-2:
    m = min(dp(cost+abs(h[p]-h[p+1]), p+1), dp(cost+abs(h[p]-h[p+2]), p+2))
    d[p] = m
    return m
  if p == n-2:
    return dp(cost+abs(h[p]-h[p+1]), p+1)

print(dp(0, 0))
# Judge status: Wrong Answer
k = int(input())
listA = [1,2,3,4,5,6,7,8,9,10,11,12]
# k = int("1")
n = 1
z = 12

q = k // z
mod = k % z
if q == 0:
    print(str(listA[mod - 1]))
else:
    print(str(q + 1)+ str(listA[mod - 1]))

# for i in range(k):

# print([1,2,3,4,5,6,7,8,9,10,11,12,21,22,23,24,25,26,27,28,29,210,211,212][int(input()) - 1])
# Judge status: Accepted
n,*a=map(int,open(0).read().split());print("YNEOS"[len(a)!=len(set(a))::2])
# Judge status: Wrong Answer
n = int(input())
S = input()
S = S.lstrip('.').rstrip('#')
print(min(S.count('.'), S.count('#')))
# Judge status: Accepted
#!/usr/bin/env python3
# input
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
res = 0
for i in range(n):
    if a[i] > b[i]:
        res -= a[i] - b[i]
    else:
        res += (b[i] - a[i]) // 2
if res >= 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
A=int(input())
B=int(input())
if A==1 and B==2:
  print(3)
elif A==2 and B==3:
  print(1)
elif A==3 and B==1:
  print(2)
elif A==1 and B==3:
  print(2)
elif A==3 and B==1:
  print(1)
else:
  print(3)
# Judge status: Accepted
x = int(input())

if 400 <= x <= 599:
    print(8)
elif 600 <= x <= 799:
    print(7)
elif 800 <= x <= 999:
    print(6)
elif 1000 <= x <= 1199:
    print(5)
elif 1200 <= x <= 1399:
    print(4)
elif 1400 <= x <= 1599:
    print(3)    
elif 1600 <= x <= 1799:
    print(2)
else:
    print(1)
# Judge status: Wrong Answer
N, W = map(int, input().split())
goods = []
for _ in range(N):
    goods.append(list(map(int, input().split())))

dp = [[0] * (W + 1) for _ in range(N + 1)]

for i in range(1, N + 1):
    for j in range(goods[i-1][0], W + 1):
        if j - goods[i - 1][0] >= 0:
            dp[i][j] = max(dp[i - 1][j - 1], dp[i - 1][j - goods[i - 1][0]] + goods[i - 1][1])
        else:
            dp[i][j] = dp[i - 1][j]
# print(dp)
print(dp[-1][-1])
# Judge status: Wrong Answer
import numpy as np

N,K = [int(i) for i in input().split()]

ab = np.ones([N,2])

ab_sort = ab[np.argsort(ab[:,0])]

cout = 0

for i in range(N):
    cout += ab_sort[i,1]
    if cout >= K:
        print(int(ab_sort[i,0]))
# Judge status: Accepted
a, b = map(int, input().split())
n = b-a
print(n*(n+1)//2-b)
# Judge status: Wrong Answer
N = int(input())
count = 1
while True:
    count = count + 1
    if N % count == 0:
        tmp = N / count
        print(int(tmp-1+count-1))
        break
# Judge status: Wrong Answer
S = input()
count = len(S)
a = 0
for i in range(count):
    if S[i] in S[i+1:]:
        a = a+1
    else:
        pass
if a>1:
    print("no")
else:
    print("yes")
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))
b = [a[i]//400 for i in range(N) if a[i] < 3200]
c = len(set(b))
print(max(1,c), c+N-len(b))
# Judge status: Accepted
x,n = map(int,input().split())
pl = list(map(int,input().split()))
if n == 0:
  print(x)
  exit()
for i in range(100):
  if not x-i in pl:
    print(x-i)
    exit()
  if not x+i in pl:
    print(x+i)
    exit()
# Judge status: Wrong Answer
A, B, C = input().strip().split()
A, B, C = [int(A), int(B), int(C)]

if B/A < 1:
    print(0)
elif B/A > C:
    print(C)
else:
    print(B/A)
# Judge status: Wrong Answer
N = input()
if "N" in N and "W" in N and "E" in N and "S" in N:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
s = input()
c = ans = s.count("E")
for i in s:
    if i=='E':
        c-=1
    else:
        c+=1
    ans = min(c,ans)
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
print(min([N % K, abs((N % K) - K)]))
# Judge status: Accepted
import numpy as np
a = []
a.append(input().split())
a.append(input().split())
a.append(input().split())
a = np.array(a).astype(int)

N = int(input())
for i in range(N):
    a[a == int(input())] = -1
    
def check(a):
    if a.max(axis=0).min() == -1:
        return "Yes"
    if a.max(axis=1).min() == -1:
        return "Yes"
    if a[0,0] + a[1,1] + a[2,2] == -3:
        return "Yes"
    if a[2,0] + a[1,1] + a[0,2] == -3:
        return "Yes"
    return "No"
print(check(a))
# Judge status: Wrong Answer
import fractions


n,X= map(int,input().split())
x = list(map(int, input().split()))
x.append(X)
x = sorted(x)

#print(x)

difflis = [0] * (n)

for i in range(n):
    difflis[i] = x[i+1] - x[i]

ans = difflis[0]
for i in range(i,len(difflis)):
    ans = fractions.gcd(ans,difflis[i])
print(ans)
# Judge status: Wrong Answer
x = int(input())

if x == 1:
	print(0)
	exit()

print(((x-1)//11)*2+int("01111122222"[(x-1)%11]))
# Judge status: Accepted
import sys
N,H=map(int,input().split())

max_swing=0
blist=[]
for i in range(N):
  a,b=map(int,input().split())
  max_swing=max(max_swing,a)
  blist.append(b)

throw_list=[]
for b in blist:
  if b>max_swing:
    throw_list.append(b)
throw_list.sort(reverse=True)
#print(max_swing,throw_list)

answer=0
for t in throw_list:
  answer+=1
  H-=t
  if H<=0:
    print(answer)
    sys.exit(0)
    
#print(answer,H,max_swing)
print(answer+(H-1)//max_swing+1)
# Judge status: Accepted
from collections import Counter
def main():
    n = int(input())
    S = [input() for _ in range(n)]
    c = Counter(S).most_common()
    V = c[0][1]
    ans = [k for k, v in c if v == V]
    [print(a) for a in sorted(ans)]

if __name__ == '__main__':
    main()
# Judge status: Accepted
N, x = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for i in range(N - 1):
  s = A[i] + A[i + 1] - x
  ans += max(0, s)
  if s > 0:
    if s <= A[i + 1]:
      A[i + 1] -= s
    else:
      A[i + 1] = 0
print(ans)
# Judge status: Accepted
n = int(input())
my_dict = dict()
for i in range(n):
    s = ''.join(sorted(input()))
    if s in my_dict:
        my_dict[s] += 1
    else:
        my_dict[s] = 1

ret = 0

for item in my_dict:
    ret += my_dict[item] * (my_dict[item] - 1) // 2

print(ret)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

all = A[0]
for a in A[1:]:
    all = all ^ a

list_a = [all ^ a for a in A]
print(*list_a)
# Judge status: Wrong Answer
s = input()
s1 = set(s)
if len(s1) == 4:
    print('Good')
else:
    print('Bad')
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a!=1 and b!=1:
  if a>b:
    print('Alice')
  elif a<b:
    print('Bob')
  else:
    print('Drew')
elif a==1 or b==1:
  if a==1:
    print('Alice')
  elif b==1:
    print('Bob')
elif a==1 and b==1:
  print('Drew')
# Judge status: Accepted
a, b = map(int, input().split())
c = a * b
d = c % 2
if d == 0:
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

m=0
for i in range(N):
  m+=B[A[i]-1]
for i in range(N-1):
  if A[i+1]==A[i]+1:
    m+=C[A[i]-1]
print(m)
# Judge status: Wrong Answer
from itertools import accumulate
N = int(input())
S = input()
SS = [1 if S[i]=='(' else -1 for i in range(N)]
SSS = list(accumulate(SS))
m = -min(SSS)

print('('*m+S+')'*(m+SSS[-1]))
# Judge status: Accepted
N,M = map(int,input().split())

AB = [list(map(int,input().split())) for _ in range(N)]

CD = [list(map(int,input().split())) for _ in range(M)]

for a,b in AB:
    tmp_point = -1
    tmp_root = 100000000000
    for i,cd in enumerate(CD):
        c,d = cd
        if abs(a-c)+abs(b-d) < tmp_root:
            tmp_root = abs(a-c)+abs(b-d)
            tmp_point = i+1
    print(tmp_point)
# Judge status: Accepted
x, y = map(int, input().split())

A = [1, 3, 5, 7, 8, 10, 12]
B = [4, 6, 9, 11]
C = [2]
a = 0
if x in A and y in A:
    a = 1
else:
    if x in B and y in B:
        a = 1
    else:
        if x in C and y in C:
            a = 1

if a == 1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, M = map(int, input().split())
WA = [0] * N
AC = [0] * N

for i in range(M):
  p,s = input().split()
  p = int(p)
  if AC[p-1] == 0:
    if s == "AC":
      AC[p-1] = 1
    else:
        WA[p-1] += 1
        
wa = 0
for j in range(N):
  if AC[j] == 1:
    wa += WA[j]
print(sum(AC),wa)
# Judge status: Accepted
def nCr(n, r):
    mod=10**9+7
    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

x,y=map(int,input().split())
f=(x+y)//3
m=-(1/3)*x+(2/3)*y
n=f-m
if (x+y)%3 or n<0 or m<0:
   print(0)
   exit()

print(nCr(int(f),int(n)))
# Judge status: Accepted
from collections import deque
N,M=map(int,input().split())
graph=[[] for i in range(N)]
for m in range(M):
    A,B=map(int,input().split())
    graph[A-1].append(B-1)
    graph[B-1].append(A-1)
queue=deque([0])
distance=[0]*N
while queue:
    room=queue.popleft()
    for next_room in graph[room]:
        if distance[next_room]==0:
            distance[next_room]=room+1
            queue.append(next_room)
if 0 in distance:
    print("No")
else:
    print("Yes")
    print(*distance[1:],sep="\n")
# Judge status: Accepted
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(i + 1)
        exit()
print(n + 1)
# Judge status: Accepted
s = ""
for i in (input()):
  if i in ["0", "1"]:
    s = s + i
  else:
    if len(s) >0:
    	s = s[:-1]

print(s)
# Judge status: Accepted
from collections import Counter
def main():
    n = int(input())
    A = list(map(int, input().split()))
    L = Counter([i + a for i, a in enumerate(A)])
    R = Counter([i - a for i, a in enumerate(A)])
    ans = 0
    for key in R.keys():
        ans += L[key] * R[key]
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())

x_max = max(a, b)
x_min = min(a, b)

y_max = max(c, d)
y_min = min(c, d)

print(max(x_max * y_max, x_max * x_min, x_min * y_max, x_min * y_min))
# Judge status: Accepted
n = int(input())

for i in range(1,10):
  for j in range(1,10):
    if i * j == n:
      print('Yes')
      break
  else:
    continue
  break
else:
  print('No')
# Judge status: Wrong Answer
N=int(input())
AC=0
WA=0
TLE=0
RE=0
for i in range(N):
    result=input()
    if result=="AC":
        AC+=1
    elif result == "WA":
        WA+=1
    elif result == "TLE":
        TLE += 1
    else:
        RE+=1

print("AC x"+str(AC))
print("WA x"+str(WA))
print("TLE x"+str(TLE))
print("RE x"+str(RE))
# Judge status: Wrong Answer
n = int(input())
z = input().split()
odd = 0
for i in range(n):
    if i % 2 == 1:
        if int(z[i]) % 2 == 1:
            odd += 1
print(odd)
# Judge status: Accepted
n,W = map(int,input().split())

w = []
v = []

for x in range(n):
    peso,valor = map(int,input().split())
    w.append(peso)
    v.append(valor)

dp = [0] * (W+1)

for i in range(n):
    for j in range(W,-1,-1):
        if j + w[i] <= W:
            dp[j+w[i]] = max(dp[j+w[i]], dp[j] + v[i])


resposta = 0

for x in dp:
    resposta = max(x,resposta)

print(resposta)
# Judge status: Accepted
import math

n = int(input())

ans = 1
if n > 1:
    ans = math.factorial(n) % (10**9 + 7)

print(int(ans))
# Judge status: Accepted
n = int(input())

a = list(map(int, input().split()))
a.sort()

ans = 1

for b in a:
    if b == 0:
        ans = 0
        break
    else:
        ans *= b
        if ans > pow(10, 18):
            ans = -1
            break

print(ans)
# Judge status: Accepted
n=int(input())
m={}
s=0
for i in input().split():
    i=int(i)
    x=m.get(i,0)
    m[i]=x+1
    s+=i
q=int(input())
for i in range(q):
    b,c=[int(i) for i in input().split()]
    x=m.get(b,0)
    y=m.get(c,0)
    m[b]=0
    m[c]=x+y
    s=s-(b*x)+(c*x)
    print(s)
# Judge status: Accepted
from sys import exit, stdin

# import copy
# from collections import deque,Counter
# import numpy as np
input = stdin.readline

X, K, D = map(int, input().split())

if abs(X) >= K * D:
    print((abs(X) - K * D))
else:
    A1 = abs(X) % D
    A2 = abs(A1 - D)
    n = int((abs(X) - A1)/D)
    if (K - n) % 2 == 0:
        print(A1)
    else:
        print(A2)
# Judge status: Accepted
s = input()
s = list(s)
t = input()
ok_num = []
for i in range(len(s) - len(t) + 1):
  check = True
  s_part = s[i:i+len(t)]
  for j in range(len(t)):
    if s_part[j] != "?" and s_part[j] != t[j]:
      check = False
  if check == True:
    ok_num.append(i)  
if len(ok_num) == 0:
  print("UNRESTORABLE")
else:
  for i in range(len(t)):
    s[max(ok_num) + i] = t[i]
  for  j in range(len(s)):
    if s[j] == "?":
      s[j] = "a"
      
  print("".join(s))
# Judge status: Accepted
A, B = map(int, input().split())
if A >= 13:
    print(B)
elif A >= 6:
    print(B//2)
else:
    print(0)
# Judge status: Accepted
from decimal import Decimal, getcontext
a,b,c = input().split()
getcontext().prec = 10000
a = Decimal(a).sqrt()
b = Decimal(b).sqrt()
c = Decimal(c).sqrt()
if a+b+Decimal('0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001') < c:
	print('Yes')
else:
  	print('No')
# Judge status: Wrong Answer
inp=lambda:list(map(int,input().split()))
import bisect as bi
n=int(input())
a=inp()
b=inp()
c=inp()
ans=0
for i in range(n):
    x=bi.bisect_left(a,b[i])
    y=n-bi.bisect_right(c,b[i])
    ans+=x*y
print(ans)
# Judge status: Accepted
from math import ceil
n, h = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
a, b =[], []
for A, B in ab:
    a.append(A)
    b.append(B)
a=sorted(a,reverse=True)
b=sorted(b,reverse=True)
ans = 0
c = 0
i = 0
while c < h:
    if i == n:
        break
    ans += 1
    if a[0] < b[i]:
        c += b[i]
    else:
        c += a[0]
        break
    i += 1
if c < h:
    ans += ceil((h - c)/ a[0]) 
print(ans)
# Judge status: Accepted
import collections

n = int(input())
s = [str(input()) for _ in range(n)]
m = int(input())
t = [str(input()) for _ in range(m)]

s,t = collections.Counter(s), collections.Counter(t)
ans = 0

for i in s.most_common():
    ans = max(ans, i[1] - t[i[0]])

print(ans)
# Judge status: Accepted
import math

n = int(input())
s = input()

eS = [0] * n
wS = [0] * n

ec = 0
for i in range(n):
    eS[i] = ec
    if s[i] == "W":
        ec += 1

wc = 0
for i in reversed(range(n)):
    wS[i] = wc
    if s[i] == "E":
        wc += 1

ans = 10000000

for i in range(n):
    ans = min(ans, eS[i] + wS[i])

print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
s = list(input())
s[k-1] = chr(ord(s[k-1])+32)
print(*s,sep="")
# Judge status: Accepted
C = [list(map(int, input().split())) for i in range(3)]
a1 = 0
b1 = C[0][0] - a1
b2 = C[0][1] - a1
b3 = C[0][2] - a1
a2 = C[1][1] - b2
a3 = C[2][2] - b3
As = [a1, a2, a3]
Bs = [b1, b2, b3]
for i in range(3):
    for j in range(3):
        if C[i][j] != As[i] + Bs[j]:
            print("No")
            exit()
print("Yes")
# Judge status: Accepted
import sys

input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
check = set(A)

if len(check) == N:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n,a,b = map(int,input().split())
S = input()
passed = 0
f_passed = 0
for s in S:
  if s == "a":
    if passed < a + b:
      print("Yes")
      passed += 1
    else:
      print("No")
  elif s == "b":
    if passed < a + b and f_passed + 1 <= b:
      print("Yes")
      passed += 1
      f_passed += 1
    else:
      print("No")
  else:
    print("No")
# Judge status: Accepted
#<B>
n = int(input())
s = input()
if s[:int(n/2)] == s[int(n/2):]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
s = input()

ans = ""
for c in s:
  ascii = ord(c) + n
  if ascii > ord('Z'):
    ascii -= 26
  ans += chr(ascii)

print(ans)
# Judge status: Accepted
from math import gcd, ceil
from functools import reduce
import sys

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N, M = map(int, input().split())
a = [int(i)//2 for i in input().split()]

s = set()
for x in a:
    cur = 0
    y = x
    while y%2 == 0:
        cur += 1
        y //= 2
    s.add(cur)
    if len(s) >= 2:
        print(0)
        sys.exit()
lcm = lcm_list(a)
print((M//lcm+1)//2)
# Judge status: Accepted
a,b=map(int,input().split())
if  a==b :
    print("Draw")
elif (b==1 or a<b) and a!=1:
    print("Bob")
else:
    print("Alice")
# Judge status: Wrong Answer
x=int(input())
y=x//11
a=x%11
if a==0:
  print(2*y)
elif a<=5:
  print(2*y+1)
else:
  print(2*y+2)
# Judge status: Accepted
import math
 
N = int(input())
A = [int(a) for a in input().split(" ")]
ave = sum(A) / N
can1 = math.floor(ave)
can2 = math.ceil(ave)
 
cost1 = sum([(a - can1) ** 2 for a in A])
cost2 = sum([(a - can2) ** 2 for a in A])
print(min([cost1, cost2]))
# Judge status: Accepted
import numpy
N = int(input())
X = [int(x) for x in input().split()]
S = sorted(X)
m0 = numpy.median(S[:-1])
m1 = numpy.median(S[1:])

for x in X:
    if x < m1:
        print(int(m1))
    else:
        print(int(m0))
# Judge status: Accepted
import numpy as np

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

ac = 0
wa = 0
test = [0] * N
count = [0] * N
for i in range(M):
    p_i, s_i = input().split(" ")
    p_i = int(p_i) - 1
    if s_i == "AC":
        test[p_i] = 1
    elif test[p_i] != 1:
        count[p_i] += 1

test = np.array(test)
count = np.array(count)

score = np.sum(test)
pena = np.sum(test * count)
print(str(int(score)) + " " + str(int(pena)))
# Judge status: Accepted
x, a, b = map(int,input().split())

if abs(x-a) < abs(x-b):
    print('A')
else:
    print('B')
# Judge status: Wrong Answer
import collections

N,K,Q = map(int,input().split())
A = [int(input()) for i in range(Q)]
c = collections.Counter(A)

if (K - Q) > 0:
    for _ in range(N):
        print('Yes')
else:
    l = []
    for i,v in dict(c).items():
        if v >(Q - K):
            l.append(i-1)
        else:
            break
    for j in range(N):
        if j in l:
            print('Yes')
#             l.pop()
        else:
            print('No')
# Judge status: Wrong Answer
M,N=map(int,input().split())
print(M//2+N)
# Judge status: Accepted
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
a = sorted(a)

l = []
for i in range(m):
  l.append(list(map(int, input().split())))
  
l = sorted(l, reverse=True, key=lambda x: x[1])

b = []
for _ in range(n):
  b.append(l[0][1])
  l[0][0] -= 1
  if l[0][0] == 0:
    l.pop(0)
  if l == []:
    break

for i in range(len(b)):
  if a[i] < b[i]:
    a[i] = b[i]
  else:
    break
    
print(sum(a))
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import math
a, b, h, m = map(int, input().split())

theta_a = math.pi * float(h + m / 60) / float(6)
theta_b = math.pi * float(m) / float(30)

theta = theta_a - theta_b
print(theta)
if theta > math.pi or theta < 0:
    theta = theta_b - theta_a

square_l = - float(2) * math.cos(theta) * float(a*b) + a * a + b * b
print(math.sqrt(square_l))
# Judge status: Accepted
import sys
input = sys.stdin.readline

def main():
    mod = 10**9+7
    n,a,b=map(int,input().split())
    f=1
    fa=0
    for i in range(1,b+1):
        f=(f*(n-i+1)*pow(i,mod-2,mod))%mod
        if i==a:
            fa=f
    ans=(pow(2,n,mod)-fa-f-1)%mod
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
s = int(input())

def collatz(n):
    if n % 2 == 0:
        return n/2
    else:
        return 3*n+1

a = []
a.append(s)
for i in range(100):
    tmp = collatz(a[i])
    if tmp in a:
        print(len(a)+1)
        exit()
    a.append(tmp)
# Judge status: Wrong Answer
def resolve():
    S = input()
    c = list(S)
    if len(c) <= 1:
        print('No')
        return

    if len(c) == 2 and S != 'hi':
        print('No')
        return

    for i in range(0, len(c) - 2, 2):
        if ''.join(c[i:i + 2]) != 'hi':
            print('No')
            return
    print('Yes')


resolve()
# Judge status: Accepted
N = int(input())
L = [2, 1]
for i in range(2, N+1):
    L.append(L[i - 1] + L[i - 2])
print(L[N])
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

excess = 0
for i in range(N):
    dif = a[i]-b[i]
    if dif < 0:
        excess += abs(dif)//2
    elif 0 < dif:
        excess -= dif

if 0<=excess:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a, b = map(int, input().split())

y = (b-2*a)//2
x = a-y

if y < 0 or x < 0:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
S, T = input().split()
print(T+S)
# Judge status: Accepted
n=int(input())
arr=[int(i) for i in input().split()]
dp=[0]*(n)
dp[0]=0
dp[1]=abs(arr[1]-arr[0])

for i in range(2,n):
    dp[i]=min(abs(arr[i]-arr[i-1])+dp[i-1],abs(arr[i]-arr[i-2])+dp[i-2])
print(dp[-1])
# Judge status: Accepted
a, b, c, d = list(map(int, input().split()))

if abs(c - a) <= d or (abs(c - b) <= d and abs(b - a) <= d):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = input()
A = list(map(int,input().split()))

count = 0
while all(a%2 == 0 for a in A):
    count += 1
    A = [a/2  for a in A]
print(count)
# Judge status: Wrong Answer
a,b,c,k = map(int,input().split())

tmp = abs(a - b)
if tmp >= k:
    print("Unfair")
elif k % 2 == 0:
    print(a - b)
else:
    print(b - a)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())

if a+b+c % 2 == 0:
    print("Yes")
else:
    print("No")