peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
al = 26
i = 1
while N > al**i:
    N -= al**(i)
    i += 1
ans = ''
a = ord('a')
while i > 0:
    ans += chr(a + (N-1) // al**(i-1))
    N = (N-1) % al**(i-1) + 1
    i -= 1
print(ans)
# Judge status: Wrong Answer
from functools import reduce
from fractions import gcd
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
x = reduce(gcd,T)
sum=x
for i in set(T):
    sum*=(i//x)
print(sum)
# Judge status: Accepted
s=input()
g=0
for i in range(len(s)):
    if i%2==0:
        if s[i]=='0':
            g+=1
    else:
        if s[i]=='1':
            g+=1
c=0
for i in range(len(s)):
    if i%2==0:
        if s[i]=='1':
            c+=1
    else:
        if s[i]=='0':
            c+=1
if g>c:
    print(c)
else:
    print(g)
# Judge status: Wrong Answer
X = int(input())

l = [0,1,2,3,4,5]
a = X // 100
b = X % 100

if a == 0:
    print('1')
elif ((b // a) in l) and ((b % a) in l):
    print('1')
else:
    print('0')
# Judge status: Accepted
import sys
N = int(input())
a = sorted([(x + l, x - l) for x, l in (map(int, l.split()) for l in sys.stdin)])

last = a[0][0]
ans = 1

for r, l in a[1:]:
    if last <= l:
        ans += 1
        last = r

print(ans)
# Judge status: Accepted
a,b,c,d=input()
print("Good" if a!=b and b!=c and c!=d else "Bad")
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

if abs(A[0]) < abs(A[-1]):
    A = A[::-1]
B = list(map(abs, A))
B.sort()
C = [x for x in A if x < 0]
n = len(C)
if (N % 2 == 0 and n % 2 == 1) or (N % 2 == 1 and n % 2 == 0):
    print(sum(B))
else:
    print(sum(B) - 2*B[0])
# Judge status: Accepted
import bisect

N= int(input())
a_list = list(map(int,input().split()))
b_list = list(map(int,input().split()))
c_list = list(map(int,input().split()))
c_num = len(c_list)

a_list.sort()
c_list.sort()

ans = 0
for b in b_list:
    a_point = bisect.bisect_left(a_list,b)
    c_point = bisect.bisect(c_list,b)
    
    ans+= a_point*(c_num-c_point)
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
c=abs(a+b)
if c%2==0:
  print(c//2)
else:
  print("IMPOSSIBLE")
# Judge status: Accepted
from collections import deque
S=input()

stack=deque()
cnt=0
for s in S:
    if not stack:
        stack.append(s)
    elif s!=stack[-1]:
        stack.pop()
        cnt+=2
    else:
        stack.append(s)
        
print(cnt)
# Judge status: Accepted
# 169A
# A * B を整数として出力せよ

# 1.入力をプログラムで扱えるように受け取ること
a, b = map(int, input().split())
# print(a, b)

# 2.受け取った入力値を使って適切に処理する（計算）こと
answer = a * b


# 3.計算した結果を出力すること
print(answer)
# Judge status: Wrong Answer
s = str(input())
k = int(input())

n = len(s)

l = [0]*n
for i in range(n):
    l[i] = ord('z') -ord(s[i]) + 1
#print(l)

ans = list(s)
i = 0
while k > 0:
    if i > n-1:
        break
    if l[i] <= k:
        ans[i] = 'a'
        k -= l[i]
    i += 1
if k > 0:
    ans[-1] = chr((k + ord(ans[-1])-ord('a'))%26+97)
#print(ans)
print(''.join(ans))
# Judge status: Accepted
def func(a):
  if a in (1,3,5,7,8,10,12):
    return "a"
  elif a in (4,6,9,11):
    return "b"
  else:
    return "c"

x, y = [int(i) for i in input().split()]

x_group = func(x)
y_group = func(y)

if x_group == y_group:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
k=b-a+1
if a%x!=0 and a!=0:
  k2=x-(a%x)
elif a%x==0 and a!=0:
  k2=0
else:
  k2=x

k-=k2
if k<=0:
  print(0)
else:
  print(k//x+1)
# Judge status: Wrong Answer
W, H, N = map(int, input().split())

border = [0,W,0,H]

for i in range(N):
  x, y, a = map(int, input().split())
  if a == 1:
    border[a-1] = max(border[a-1], x)
  elif a == 2:
    border[a-1] = min(border[a-1], x)
  elif a == 3:
    border[a-1] = max(border[a-1], y)
  elif a== 4:
    border[a-1] = min(border[a-1], y)

print(max((border[1] - border[0]) * (border[3] - border[2]), 0))
# Judge status: Wrong Answer
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
ans = []
ans.append(min(X//500,A))
ans.append(min(X//100,B))
ans.append(min(X//50,C))
for i in range(ans[0]):
    for j in range(ans[1]):
        for k in range(ans[2]):
            p = i * 500 + j * 100 + k * 50
            if p == X:
                count += 1
print(count)
# Judge status: Accepted
N = input()
if N[0] == '9' or N[1] == '9':
    print('Yes')
else:
    print('No')
# Judge status: Accepted
w = input()
ans = 'No'

for wd in w:
    if w.count(wd) % 2 != 0:
        break
else:
    ans = 'Yes'

print(ans)
# Judge status: Accepted
c = input()
l = ["a", "e", "i", "o", "u"]

if (c in l):
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
import sys
input = sys.stdin.readline

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

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

a,b,c=map(int, input().split())

if a%c==0:
    print(b//c-a//c+1)
else:
    print(b//c-a//c)
# Judge status: Wrong Answer
N,K=input().split()
N=int(N)
K=int(K)
scores=input().split()
scores=[int(i) for i in scores]
count=0
boad=0
for gakki in range(K,N+1):
  score=1
  for i in scores[gakki-K:gakki]:
    score*=i
  if count==0:
    count+=1
    boad=score

    continue
  elif score>boad:
    print('Yes')
    continue
  else:
    print('No')
    
  boad=score
# Judge status: Wrong Answer
a,b=map(int,input().split())

cnt=0
if (a>0 and b<0) or (a<0 and b>0):
  ans="Zero"
elif a==0 or b==0:
  ans="Zero"
elif a>0 and b>0:
  ans="Positive"
elif a<0 and b<0:
  a,b=a*-1,b*-1
  print(a,b)
  for i in range(b,a+1):
    cnt+=1
  if cnt%2==0:
    ans="Positive"
  else:
    ans="Negative"
    
print(ans)
# Judge status: Wrong Answer
def main():
    s = input()
    mudancas=0;
    s=list(s)
    if(len(s)==1):
        print("0")
        return;
    for i in range(1, len(s)-1):
        if(s[i]==s[i-1]):
            mudancas+=1
            if(s[i]=='0'):
                s[i]='1'
            else:
                s[i]='0'
    print(mudancas)
    
main()
# Judge status: Accepted
N = int(input())
S = [input() for _ in range(N)]

from collections import Counter

L = [''.join(sorted(list(s))) for s in S]
C = Counter(L)
ans = 0
for i in C.values():
    ans += i*(i-1)//2
print(ans)
# Judge status: Accepted
x = int(input())
print(x // 11 * 2 + (x % 11 + 5) // 6)
# Judge status: Accepted
n,k = map(int,input().split())
d = input().replace(" ","")
for i in range(n,10**9):
  check = True
  for j in str(i):
    if j in d:
      check = False
      break
  if check:
    print(i)
    break
# Judge status: Accepted
n = int(input())
s = input()
cnt = 0
for i in range(n):
    for j in range(i + 1, n):
        k = 2*j - i
        if j < k < n and len({s[i], s[j], s[k]}) == 3:
            cnt += 1
print(s.count('R') * s.count('G') * s.count('B') - cnt)
# Judge status: Accepted
n, k, x, y = map(int, [input() for i in range(4)])

if n <= k:
  print(x*n)
else:
  print(x*k + y*(n-k))
# Judge status: Wrong Answer
S = input()
even = [v for i, v in enumerate(S) if i % 2 == 0]
odd = [v for i, v in enumerate(S) if i % 2 == 1]
count = even.count("R") + odd.count("L")
print("Yes" if count == 0 else "No")
# Judge status: Accepted
N = input()
if N[-1] == '2' or N[-1] == '4' or N[-1] == '5' or N[-1] == '7' or  N[-1] == '9':
    print('hon')
elif N[-1] == '3':
    print('bon')
else:
    print('pon')
# Judge status: Accepted
n = int(input())
B = list(map(int, input().split()))
ans = B[0] + B[n-2]
for i in range(0, n-2):
    ans += min(B[i], B[i+1])
print(ans)
# Judge status: Accepted
S = list(map(str, input()))
count1 = 0
count2 = 1
while count1+1 <= len(S):
    if S[count1] == 'L':
        print('No')
        break
    else: count1 +=2
else:
    while count2 < len(S):        
        if S[count2] == 'R':
            print('No')
            break
        else:
            count2 += 2
    else:
        print('Yes')
# Judge status: Accepted
def LI():
    return list(map(int, input().split()))


P, Q, R = LI()
ans = P+Q+R-max(P, Q, R)
print(ans)
# Judge status: Accepted
import sys
import string
w = input()
a_z = string.ascii_letters
for i in a_z:
    if w.count(i) & 1:
        print('No')
        sys.exit()
print('Yes')
# Judge status: Wrong Answer
N,K = map(int,input().split())
n = abs(N-K)
if(N == K):
    print(0)
if(K>N):
    if(n<N):
        print(n)
    else:
        print(N)
if(K<N):
    mod = N % K
    print(mod)
# Judge status: Accepted
N,x=map(int,input().split())
a=list(map(int,input().split()))

a.sort()

Q=0
for i in range(N):
    if x>=a[i] and i!=N-1:
        Q+=1
        x=x-a[i]
    elif i==N-1 and x==a[i]:
        Q+=1
print(Q)
# Judge status: Accepted
X,Y,Z=map(int,input().split())
W=Y+Z
cnt=0
X-=Z*2
while X>W:
    X-=W
    cnt+=1
if X>=Y:
    cnt+=1
print(cnt)
# Judge status: Accepted
import numpy as np

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

total_vote = np.sum(A)
threshold = total_vote/(4*M)
A.sort(reverse = True)
if A[M-1] >= threshold:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def main():
    #N,K=map(int,input().split())
    #p=list(map(int,input().split()))
    N=int(input())
    ans=""
    while N!=0:
        tmp=N%26
        N//=26
        if tmp==0:
            ans="z"+ans
            N-=1
        else:
            ans=chr(tmp-1+ord("a"))+ans
    print(ans)

main()
# Judge status: Accepted
x = int(input())

y = x // 11
z = x % 11

ans = 0
ans += y * 2
if z > 6:
  ans += 2
elif z > 0:
  ans += 1
  
print(ans)
# Judge status: Wrong Answer
a=int(input())
sum=0
if a//100==1:
    sum+=1
if a//10==(1 or 11):
    sum+=1
if a%2==1:
    sum+=1
print(sum)
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split(" ")))

cost_list = []

for i in range (-100,101):
    cost = 0
    for j in l:
        cost += (j - i)**2
    cost_list.append(cost)
cost_list.sort()
print(cost_list[0])
# Judge status: Accepted
def pas():
    s = input()
    for i in range(len(s)-1):
        if s[i] == s[i+1] and i !=len(s)-1:
            return 'Bad'
    return 'Good'
print(pas())
# Judge status: Accepted
s = input()
ans = ["hi", "hihi", "hihihi", "hihihihi", "hihihihihi"]
if s in ans:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import math
n = int(input())
l = [int(input()) for i in range(5)]

print(math.ceil(n / min(l))+4)
# Judge status: Accepted
N,C,K = map(int,input().split())
T = sorted([int(input()) for _ in range(N)])

bus = 1
tmp_bus = 1
bus_time = T[0] + K

for t in T[1:]:

    if tmp_bus < C and t <= bus_time:
        tmp_bus += 1
    else:
        bus += 1
        bus_time = t + K
        tmp_bus = 1

print(bus)
# Judge status: Accepted
s = input()
t = input()
if s == t[:-1]: print("Yes")
else: print("No")
# Judge status: Wrong Answer
n = int(input())
a = []
for i in range(n):
    p = int(input())
    a.append(p)
q = 0
ans = 0
a.reverse()
s = a[0]
for i in range(n-1):
    if a[i] <= a[i+1]:
        q += 1
    else:
        ans = max(ans,q)
        q = 0
ans = max(ans,q)
print(ans+1)
# Judge status: Accepted
def chmin(dp, i, *x):
  dp[i] = min(dp[i], *x)
INF = float("inf")

# dp[i] := min 消耗する魔力 to H -= i
h, n = map(int, input().split())
dp = [0] + [INF]*h
for _ in [None]*n:
  a, b = map(int, input().split())
  for j in range(h + 1):
    chmin(dp, min(j + a, h), dp[j] + b)
print(dp[h])
# Judge status: Accepted
a=list(input())
b=list(input())
c=list(input())
d=a.pop(0)
while True:
  if d=="a" and a!=[]:
    d=a.pop(0)
  elif d=="a" and a==[]:
    flag="A"
    break
  if d=="b" and b!=[]:
    d=b.pop(0)
  elif d=="b" and b==[]:
    flag="B"
    break
  if d=="c" and c!=[]:
    d=c.pop(0)
  elif d=="c" and c==[]:
    flag="C"
    break
print(flag)
# Judge status: Accepted
N=int(input())
d=[0]*N;D=[0]*N
s=0
for i in range(N):
  d[i],D[i]=map(int,input().split())
  if d[i]==D[i]:s+=1
  else:s=0
  if s==3:
    print('Yes')
    exit()
    
print('No')
# Judge status: Wrong Answer
import sys
import math
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))

n = ini()
a = inl()
x = sum(a) // n
ans = 0
for i in a:
    ans += (i - x) * (i - x)
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
if 2*n>=m:
    print(m//2)
else:
    x=(m-2*n)//4
    ans=min(n+x,(m-2*x)//2)
    x+=1
    anser=min(n+x,(m-2*x)//2)
    print(max(ans,anser))
# Judge status: Accepted
N, Y = [int(x) for x in input().split()]

for x in range(Y // 10000 + 1): # 1万円札の枚数
    for y in range((Y - 10000 * x) // 5000 + 1): # 5千円札の枚数
        if 10000 * x + 5000 * y + 1000 * (N - x - y) == Y:
            print(x, y, N - x - y)
            break
    else:
        continue
    break
else:
    print(-1, -1, -1)
# Judge status: Accepted
import sys
input = sys.stdin.readline

S = input().rstrip()
s_cnt =0
t_cnt =0

for s in S:
    if s == 'S':
        s_cnt += 1
    else:
        if s_cnt >0:
            s_cnt -= 1
        else:
            t_cnt += 1
            
print(t_cnt + s_cnt)
# Judge status: Accepted
x, y = map(int, input().split()) #3, 8
ans = "No"
for i in range(1, x+1):
    if (4*i + 2*(x-i)) == y:
        ans = "Yes"
        break
if (2*(x)) == y:
        ans = "Yes"
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())

if a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:
    print('Possible')
else:
    print('Impossible')
# Judge status: Accepted
H, N = map(int, input().split())
A = list(map(int, input().split()))

ans = 0
for i in A:
    ans += i

if ans >= H:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
s = input()
cnt, L = 0, 0
for i in range(len(s)):
    if s[i] == '(':
        cnt += 1
    else:
        cnt -= 1

    if cnt < 0:
        L = min(L, cnt)

ans = '('*abs(L) + s
R = ans.count('(') - ans.count(')')
ans += ')'*R

print(ans)
# Judge status: Wrong Answer
# input
cook_time = []
append = cook_time.append

for i in range(5):
    append(int(input()))

# check
cook_time.sort(key=lambda x: round(x, -1) - x)
res = 0
for c in cook_time:

    if res % 10 != 0:
        res = round(res, -1)

    res += c

print(res)
# Judge status: Accepted
a, b = map(int, input().split())
if a <= b:
    print(a)
else:
    print(a-1)
# Judge status: Accepted
s = input()
K = int(input())

for i,c in enumerate(s):
	x = (ord('z')-ord(c)+1)%26
	if x <= K:
		s = s[:i]+'a'+s[i+1:]
		K -= x

print(s[:-1]+chr((ord(s[-1])-ord('a')+K)%26+ord('a')))
# Judge status: Accepted
import math
l = []
n = int(input())
for i in range(2,int(math.sqrt(n))+1):
  flg = 0
  while n % i == 0:
    if flg == 0:
      l.append(1)
      flg = 1
    else:
      l[-1] += 1
    n = n//i

if n != 1:
  l.append(1)

ans = 0
for i in range(len(l)):
  c = 1
  while l[i] - c >= 0:
    l[i] -= c
    c += 1
    ans += 1

print(ans)
# Judge status: Wrong Answer
l = int(input())
 
a = map(int, input().split())
a = sorted(a, reverse=True)
#print(a)
if l%2==0:
	print(a[0] + sum(a[1:(l-2)//2])*2 + a[(l-2)//2])
else:
	print(a[0] + sum(a[1:(l+1)//2])*2)
# Judge status: Accepted
a,b=map(int,input().split())
if (a+b)%2==0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
n,k = map(int,input().split())
h = list(map(int,input().split()))

h.sort(reverse=True)
h = h[k:]
print(sum(h))
# Judge status: Accepted
N, M = map(int, input().split())

if 2 * N >= M:
    print(M // 2)
else:
    d = M - 2 * N
    d //= 4
    print(N + d)
# Judge status: Accepted
x = int(input())
print(0) if (x - (x // 100)*100) / 5 > x // 100 else print(1)
# Judge status: Accepted
a,b = input().split()
c = int(a+b)

if c==int(c**.5)**2:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N,K = map(int, input().split())
A_list = list(map(int, input().split()))

for i in range(N-K):
  #print(i,K+i)
  #print(A_list[i],A_list[K+i])
  if(A_list[i]<A_list[K+i]):
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
n,m=map(int,input().split())
if n>9 or m>9:
  print(-1)
else:
  print(n*m)
# Judge status: Accepted
n, k = map(int, input().split())
A = [*map(int, input().split())]
for i in range(k):
    B = [0]*(n+1)
    for j in range(n):
        l = max(0, j - A[j])
        r = min(n, j + A[j] + 1)
        B[l] += 1; B[r] -= 1
    for j in range(n-1): B[j+1] += B[j]
    B.pop()
    if A == B: break
    A = B
print(*A, sep=' ')
# Judge status: Accepted
N, X, Y= map(int, input().split())
K = [0]*(N-1)
for i in range(1,N):
    for j in range(i+1, N+1):
        idx = min([j-i, abs(X-i)+ abs(j-Y)+1, abs(Y-i) + 1 + abs(X-j)])-1
        K[idx] +=1
for value in K:
    print(value)
# Judge status: Accepted
n=int(input())
c=input()
a=c.count('R')
print(c[:a].count('W'))
# Judge status: Accepted
hon = ['2','4','5','7','9']
pon = ['0','1','6','8']

n = input()

if n[-1] in hon:
    print('hon')
elif n[-1] in pon:
    print('pon')
else:
    print('bon')
# Judge status: Wrong Answer
N = int(input())

answer = (N + 1) * N / 2

print(answer)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
ret = 1
if 0 in A:
    print(0)
    exit()

for i in A:
    ret *= i
    if ret > 10**18:
        ret = -1
        break
print(ret)
# Judge status: Accepted
a,b,c=(int(x) for x in input().split())

print(str(c)+" "+str(a)+" "+str(b))
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=sum(B)

for n in range(1,N):
    if A[n]-A[n-1]==1:
        ans+=C[A[n-1]-1]

print(ans)
# Judge status: Accepted
def please(n , a):

    for i in range(n):
        if a[i] % 2 == 0:
            if a[i] % 3 != 0 and a[i] % 5 != 0:
                return "DENIED"
    
    return "APPROVED"

def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(please(n , a))

if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b, c = map(int, input().split())
if a + b + c >= 22:
  print("bust")
else:
  print("win")
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]

ball_count = [0] * (n + 1)

for i in a:
    ball_count[i] += 1
def nCr(i):
    if i<=1:
        return 0
    else:
        return i*(i-1)//2

def get_total(ball_count):
    ans = 0
    for i in ball_count:
        ans += nCr(i)
    return ans


total = get_total(ball_count)
for i in range(1, n + 1):
    num = ball_count[a[i - 1]]
    ans = total - nCr(num) + nCr(num-1)
    print(ans)
# Judge status: Wrong Answer
import math
A,B,H,M = map(int, input().split())
sita = abs(0.5 * M - 30 * H)
ans = (A**2 + B**2 - 2 * A * B * math.cos(math.radians(sita)))** 0.5
print(ans)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = [a % 10, b % 10, c % 10, d % 10, e % 10]
print((a // 10) * 10 + (b // 10) * 10 + (c // 10) * 10 + (d // 10) * 10 + (d // 10) * 10 - max(l))
# Judge status: Wrong Answer
x, y = map(int,input().split())
z=-2

for i in range(x):
    if i % 2 == 0:
            z +=4
    else:
            z +=2
    if z == y :
        print("Yes")
    elif z==(y-2):
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
A.sort()

i=N-1
ans=1
count=0
while i>=1:
    if A[i-1]==A[i]:
        ans*=A[i]
        i-=2
        count+=1
    else:
        i-=1
    if count==2:
        print(ans)
        break
else:
    print(0)
# Judge status: Accepted
A,B,C=map(int,input().split())
if A+B+C>=22:print("bust")
else:print("win")
# Judge status: Accepted
def solve():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort(reverse=True)
    
    ans = 0
    for i in range(N-1):
        if i == 0:
            ans += A[0]
        else:
            if i % 2 == 0:
                ans += A[i//2]
            else:
                ans += A[i//2 + 1]
    
    print(ans)

if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

ans = 0

for i in range(n):
    for j in range(i+a[i]+1,n):
        print(i,j)
        if a[i]+a[j] == j-i:
            ans += 1
print(ans)
# Judge status: Wrong Answer
h = int(input())

res = 0
i = 1

while h > 0:
  h = h//2
  res = res + i
  i*2
print(res)
# Judge status: Accepted
d = int(input())
if d == 25:
  print('Christmas')
elif d == 24:
  print('Christmas Eve')
elif d == 23:
  print('Christmas Eve Eve')
else:
  print('Christmas Eve Eve Eve')
# Judge status: Wrong Answer
#!/usr/bin/env python3
S = input()
if 'hi' in S:print('Yes')
else: print('No')
# Judge status: Accepted
a,b=map(int,input().split())
ans=0
for i in range(2):
    if a>=b:
        ans+=a
        a-=1
    else:
        ans+=b
        b-=1
print(ans)
# Judge status: Accepted
N = int(input())
numbers = [0] * (10 ** 6)
seq = list(map(int, input().split()))
for i in seq:
    numbers[i - 1] += 1
    numbers[i] += 1
    numbers[i + 1] += 1
print(max(numbers))
# Judge status: Accepted
N = int(input())
print((N*(N+1))//2)
# Judge status: Wrong Answer
h1, m1, h2, m2, k = map(int, input().split())
hm1 = h1 + m1/60
hm2 = h2 + m2/60
diff = hm2 - hm1
if diff > k/60:
    ans = int((diff - k/60)*60)
else:
    ans = 0
print(ans)
# Judge status: Accepted
S = [input() for _ in range(2)]
count = 0
for i in range(len(S[0])):
    if S[0][i] != S[1][i]:
        count += 1
print(count)
# Judge status: Accepted
n = int(raw_input())
d = 1 
m = +float('inf')
while(d * d <= n):
	if n % d == 0:
		m = min(m, n/d -1 + d -1)
	d+=1
print m
# Judge status: Wrong Answer
import math

x,y = map(int,input().split())
print(int(math.log2(y/x))+1)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

r1=0
for jj in range(n):
  r1=r1^a[jj]

r=[0]*n
for ii in range(n):
  r[ii]=r1^a[ii]
"""
for ii in range(n):
  print(bin(a[ii]),bin(r[ii]))
"""
print(*r)
# Judge status: Accepted
n = int(input())
a = sorted(list(map(int,input().split())))
print(sum(a[n::2]))
# Judge status: Accepted
import math
N = int(input())

stations = []
for n in range(N-1):
  tmp = tuple(map(int, input().split()))
  stations.append(tmp)

for index in range(len(stations)):
  time = 0
  sum_time = 0
  for c, s, f in stations[index:]:
    if time <= s:
      time = s + c
    else:
      diff = time - s
      count = math.ceil(diff/f)
      time = s + f*count + c
  print(time)
print(0)
# Judge status: Accepted
N,K=map(int, input().split())
A=list(map(int, input().split()))
if K==0:
  print(max(A))
  exit()
def f(x):
  cnt=0
  for i in A:
    if i%x==0:
      cnt+=i//x-1
    else:
      cnt+=(i//x)
  if cnt<=K:
    return True
  else:
    return False
ok=1
ng=1000000000
for i in range(50):
  mid=(ok+ng)//2
  if f(mid):
    ng=mid
  else:
    ok=mid
print(ng)
# Judge status: Wrong Answer
n = int(input())
c = input()

rtow = c.count('R')
wtor = 0

anses = []
for i in range(n):
  if c[i] == 'W':
    wtor += 1
  else:
    rtow -= 1
  anses.append(max(rtow, wtor))

print(min(anses))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
M = 1000
for i in range(len(A)-1):
    if A[i+1] > A[i]:
        M+= M//A[i]*(A[i+1]-A[i])
print(M)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0
for i in range(n):
    if a[i] <=  b[i]:
        ans += a[i]
        b[i] -= a[i]
    else:
        ans += b[i]
        b[i] = 0
    if b[i] > 0:
        if a[i+1] > b[i]:
            ans += b[i]
        else:
            ans += a[i+1]
            a[i+1] = 0
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
  print(sum(map(abs, a)))
  exit()
minus = len([i for i in range(n) if a[i]<0 ])
if minus % 2 == 0:
  print(sum(map(abs, a)))
else:
  a = sorted(a, key=lambda x: abs(x))
  print(sum(map(abs, a[1:])))
# Judge status: Accepted
#abc093 b
a,b,k=map(int,input().split())
l1=[i for i in range(a,min(a+k,b+1))]
l2=[i for i in range(max(a,b-k+1),b+1)]
ans=set(l1+l2)
for i in sorted(ans):
    print(i)
# Judge status: Accepted
w,h,x,y=map(int,input().split())

if x==(w/2)and y==(h/2):
    print(str((w*h)/2)+' 1')
else:
    print(str((w*h)/2)+' 0')
# Judge status: Wrong Answer
N, M, Q = map(int, input().split())
A = [list(map(int,input().split())) for i in range(Q)]
cnt_all = [ ]
for i in range(M):
  cnt = 0
  for j in range(Q):
    if 0 < (M-i)-A[j][2] == A[j][2] and M-i <= A[j][2]:
      cnt += A[j][3]
  cnt_all.append(cnt)
print(max(cnt_all))