peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
A,B,C=map(int,input().split())
odd = A%2+B%2+C%2
answer = 0
if odd == 1:
  answer = 1
  if not A%2:
    A += 1
  if not B%2:
    B += 1
  if not C%2:
    C += 1
elif odd == 2:
  answer = 1
  if A%2:
    A += 1
  if B%2:
    B += 1
  if C%2:
    C += 1
D = sorted([A,B,C])
answer += (D[2]-D[0])//2+(D[2]-D[1])//2
print(answer)
# Judge status: Accepted
n = int(input())
if(n < 1000): print('ABC')
else: print('ABD')
# Judge status: Accepted
import numpy as np
a, b = input().split()
if np.sqrt(int(a+b)).is_integer():
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
nums = list(map(int, input().split()))

nums.sort()

if nums[0] == nums[1] and nums[1] != nums[2]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
L,R,d = map(int,input().split())

res = 0
for v in range(L,R+1):
    res += 1 if v%d == 0 else 0

print(res)
# Judge status: Wrong Answer
def check(arr):
	if arr:
		return arr.pop()
	else:
		return False


stringa = str(input())
stringb = str(input())
stringc = str(input())
stringa = list(stringa)
stringb = list(stringb)
stringc = list(stringc)
temp = stringa.pop()
last_temp = ''
while temp:
	if temp=='a':
		last_temp = temp
		temp = check(stringa)
	elif temp=='b':
		last_temp = temp
		temp = check(stringb)
	else:
		last_temp = temp
		temp = check(stringc)
print(last_temp.capitalize())
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
if b<=c or d<=a:
    print('0')
elif min(b-a,d-c)>(b-c):
    print(b-c)
else:
    print(min(b-a,d-c))
# Judge status: Accepted
a = int(input())

s = input()

if a >= 3200:
    print(s)

else:
    print('red')
# Judge status: Accepted
MOD = 10**9 + 7
N, K = list(map(int, input().split()))

ans = 0

n = [i for i in range(N+1)]

l_sum = sum(n[:K])
r_sum = sum(n[-K:])

l = K
r = N-K

for i in range(K, N+1):
    ans = (ans + r_sum - l_sum + 1) % MOD
    
    l_sum += n[l]
    r_sum += n[r]
    
    l += 1
    r -= 1
    
print((ans+1)%MOD)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))

min = None
for y in range(-100, 100):
    sum = 0
    for x in a:
        sum += abs(x - y) ** 2
    if min is None or min > sum:
        min = sum

print(min)
# Judge status: Accepted
A,B,C,D=map(int,input().split())
while True:
    C-=B
    if C<=0:
        print("Yes")
        break
    A-=D
    if A<=0:
        print("No")
        break
# Judge status: Accepted
N=int(input())
p=list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(1,len(p)+1):
    if i == p[i-1]:
        cnt += 1
    elif cnt == 1:
        ans += 1
        cnt = 0
    if cnt == 2:
        ans += 1
        cnt = 0
if cnt == 1:
    ans += 1
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
from collections import deque
from math import gcd
a_left=deque()

a_left.append(a[0])


a_right=deque()

a_right.append(a[-1])

for i in range(n-1):
    a_left.append(gcd(a_left[-1],a[i+1]))
    a_right.appendleft(gcd(a_right[0],a[n-i-2]))


a_right=list(a_right)
a_left=list(a_left)

count=max(a_left[-2],a_right[1])

for j in range(n-2):
    count=max(gcd(a_left[j],a_right[j+2]),count)
print(count)
# Judge status: Wrong Answer
N=int(input())
sisterN=[]
for n in range(N):
    _=int(input())
    sisterN.append(_)
Ans=len(set(sisterN))
print(Ans)
# Judge status: Accepted
import fractions 
n = int(input())
t = [int(input()) for i in range(n)]
def lcm(a, b):
  return (a * b) // fractions.gcd(a, b)

#入力tについて、最小公倍数を求めればそれが答えとなる
if n == 1:
  print(t[0])
else:
  ans = lcm(t[0], t[1])
  for i in range(2, n):
    ans = lcm(ans, t[i])
  print(ans)
# Judge status: Accepted
n = int(input())

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

cnt_1 = 0
cnt_2 = 0
for i in a:
    if i%4 == 0:
        cnt_1 += 1
    elif i%2 == 0:
        cnt_2 += 1
    
cnt_2 //=2

total = cnt_1 + cnt_2

if len(a)//2 <= total:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s = list(map(int,input().split()))

temp = 0

for n in s:
    if n % 2:
        temp += 1

print(temp)
# Judge status: Wrong Answer
from collections import deque
x,y=map(int,input().split())
citylist=deque([[] for x in range(x)])
inputlist=deque()
arucity=set()
for a in range(y):
    s,t=map(int,input().split())
    citylist[s-1].append(t)
    inputlist.append(s)
    inputlist.append(t)
    arucity.add(s)
for a in arucity:
    citylist[a-1].sort()
for b in range(y):
    e=inputlist.popleft()
    print("{:08} {:08}".format(e,(citylist[e-1].index(inputlist.popleft())+1)))
# Judge status: Wrong Answer

if __name__ == "__main__":
  N, K = [int(a) for a in input().split()]
  P = list(map(int, input().split()))
  list.sort(P)
  print(P)
  ans = sum(P[:K])
  print(ans)
# Judge status: Wrong Answer
n = int(input())
a = sorted(list(map(int,input().split())))
sum_a = 0
for i in range(n):
    print(a[n//2+1+i])
    sum_a += a[len(a)//2+i]
print(sum_a)
# Judge status: Accepted
from math import gcd
k = int(input())
ans = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            ans += gcd(gcd(a, b), c)
print(ans)
# Judge status: Accepted
n = int(input())

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

tmp = 1
idx = 0
while True:
	tmp *= 5
	if tmp >= n:
		break
	idx += 1

ans = 0
for i in range(idx):
	ans += (n // (5 ** (i + 1))) // 2

print(ans)
# Judge status: Wrong Answer
import sys
k=int(input())
a,b=map(int,input().split())
for i in range(a+1,b+1):
  if (i % k)==0:
    print("OK")
    sys.exit()
print("NG")
# Judge status: Accepted
import sys
a,b=map(int,input().split())
X=10**len(str(b))*a+b

K=1
while K*K<=X:
    if K*K==X:
        print("Yes")
        sys.exit()
    K+=1
print("No")
# Judge status: Accepted
x, y = map(int, input().split())
if y%2==0 and 2*x<=y<=4*x:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N,K=list(map(int,input().split()))
N-=K
K-=1
ans=1
while N>0:
  ans+=1
  N-=K
print(ans)
# Judge status: Wrong Answer
a = [int(input()) for _ in range(3)]

if a[0] == a[1]:
	print(a[0] ** 2)
else:
	print(int((a[0] + a[1]) * a[2] / a[2]))
# Judge status: Accepted
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

def goukei(N,K,X,Y):
    money = 0
    if N > K:
        for i in range(K):
            money += X
    else:
        for i in range(N):
            money += X
    if N - K > 0:
        for j in range(N-K):
            money += Y
    return money

print(goukei(N,K,X,Y))
# Judge status: Accepted
X = input()

s_cnt = 0
t_cnt = 0

ans = 0

for n in range(len(X)):
  if X[n] == "S":
    s_cnt += 1
  else:
    t_cnt += 1
  ans = max(ans,t_cnt-s_cnt)
print(ans*2)
# Judge status: Accepted
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

s_a = [0]
s_b = [0]
for i in range(n):
    s_a.append(s_a[i] + a[i])
for i in range(m):
    s_b.append(s_b[i] + b[i])

ans = 0
tmp = m
for i in range(n+1):
    for j in range(tmp+1)[::-1]:
        if s_a[i] + s_b[j] <= k:
            ans = max(ans, i+j)
            tmp = j
            break
print(ans)
# Judge status: Accepted
import math
a,b = map(int, input().split())

print(math.ceil((a+b)/2))
# Judge status: Wrong Answer
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
at=0
bt=0
al=[0]*n
bl=[0]*m
for i in range(n):
  at=at+a[i]
  al[i]=at
for j in range(m):
  bt=bt+b[j]
  bl[j]=bt
t=m-1
ans=0
i=0
while i<n:
  if al[i]+bl[t]<=k:
    ans=max(ans,i+t+2)
    i=i+1
  else:
    t=t-1
  if i==n or t==-1:
    break
print(ans)
# Judge status: Accepted
k, x = list(map(int, input().split()))
print('Yes') if k *500 >= x else print('No')
# Judge status: Wrong Answer
def main():
    n = int(input())
    h = list(map(int, input().split()))

    pre = 0
    for i in range(n):
        if h[i] >= pre + 1:
            h[i] -= -1
        if h[i] < pre:
            print('No')
            break
        pre = h[i]
    
    print('Yes')
                

if __name__ == '__main__':
    main()
# Judge status: Accepted
x = int(input())
num_500 = x // 500
x -= num_500 * 500
num_5 = x // 5
print(1000 * num_500 + 5 * num_5)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i+100*j+50*k == x:
                cnt += 1
print(cnt)
# Judge status: Accepted
import collections
n,x,y = map(int,input().split())

disList = []
for i in range(1,n):
    for j in range(i+1,n+1):
        dis = min(abs(j-i), abs(x-i) +1 + abs(j-y),abs(y-i) + 1 + abs(j-x))
        disList.append(dis)

c = collections.Counter(disList)
cList = list(c.values())
for i in range(n-1):
    if(i < len(cList)):
        print(cList[i])
    else:
        print(0)
# Judge status: Accepted
n = int(input())
if n%2 == 0:
    print(0.5)
else:
    print((n//2 + 1)/n)
# Judge status: Wrong Answer
N,M = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(N)]

s_A = sorted(A)

cost = 0
bought = 0
for n in range(N):
  for _ in range(s_A[n][1]):
    cost += s_A[n][0]
    bought += 1
    if bought == M:
      break
print(cost)
# Judge status: Wrong Answer
from collections import Counter


def solve(n, arr):
    arr.sort()

    if arr[0] != 0:
        return 0

    c = Counter(arr)

    if len(c) != max(c.keys()) + 1:
        return 0

    c = list(c.values())

    prev = c[0]
    ans = 1
    mod = 998244353

    for i in c[1:]:
        if i > prev * 2:
            return 0
        else:
            ans = ans * pow(prev, i, mod) % mod
            prev = i

    return ans


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

print(solve(n, arr))
# Judge status: Accepted
import sys
import heapq
input = sys.stdin.readline
N, M = map(int, input().split())
a = []
for _ in range(N):
  u, v = map(int, input().split())
  a.append((u, v))
a.sort(key = lambda x: -x[0])
h = []
res = 0
#print(a)
for i in range(M + 1):
  while len(a):
    if a[-1][0] > i: break
    heapq.heappush(h, -a.pop()[1])
  if len(h):
    res += heapq.heappop(h)
print(-res)
# Judge status: Accepted
import sys
input = sys.stdin.readline

N = int(input())
S = list(input().rstrip())

A1 = [0]*(N+1)
A2 = [0]*(N+1)

t = 0
for i, s in enumerate(S):
    if s == "W":
        t += 1
    A1[i+1] = t

t = 0
for i in reversed(range(N)):
    if S[i] == "R":
        t += 1
    A2[i] = t

ans = 10**18
for a1, a2 in zip(A1, A2):
    score = abs(a1-a2) + min(a1, a2)
    ans = min(ans, score)

print(ans)
# Judge status: Wrong Answer
X, Y = [int(v) for v in input().split()]

ans = "No"
for c in range(X + 1):
    t = X - c
    if 2 * c + 3 * t == Y:
        ans = "Yes"
        break
if ans == "No":
    for t in range(X + 1):
        c = X - t
        if 2 * c + 3 * t == Y:
            ans = "Yes"
            break

print(ans)
# Judge status: Accepted
from itertools import accumulate

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

b = list(accumulate(a))
ma = b[-1]
mi = 10**10
for sunuke in b[:N-1]:
    arai = ma - sunuke
    if abs(sunuke - arai) < mi:
        mi = abs(sunuke - arai)
print(mi)
# Judge status: Wrong Answer
x,a,b=map(int,input().split())
if b-a<=x and b-a>=0:
  print('safe')
elif a-b>=0:
  print('delicious')
else:
  print('dangerous')
# Judge status: Accepted
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M = map(int, readline().split())
m = map(int, read().split())

count = [1] * (N+1)
red = [0] * (N+1)
red[1] = True
for x, y in zip(m, m):
    count[x] -= 1
    count[y] += 1
    if red[x]:
        red[y] = 1
    if not count[x]:
        red[x] = 0

print(sum(red))
# Judge status: Accepted
n,*a=map(int,open(0).read().split());print("Yes" if sum((j-i)//2*2 if j-i>0 else 2*(j-i)for i,j in zip(a[:n],a[n:]))>=0 else "No")
# Judge status: Accepted
S = list(input())
cnt = 0
for i in range(len(S)):
    if i%2 == 0:
        if S[i] == '0':
            cnt += 1
    if i%2 == 1:
        if S[i] == '1':
            cnt += 1
print(min(cnt,len(S)-cnt))
# Judge status: Accepted
N = int(input())
P = list(map(int, input().split()))
ans =1 
newP = P[0]
for i in range(1, N):
    newP = (min(newP, P[i]))
    if newP == P[i]:
        ans += 1

print(ans)
# Judge status: Wrong Answer
K = int(input())
if K==7 or K==1:
        print(1)
if K==11:
        print(2)
if K in (3,37,3*37):
    print(3)
elif K in (11,101,1111):
    print(4)
elif K in (41,271,11111):
    print(5)
elif K in (3, 7, 11, 13, 21, 33, 37, 39, 77, 91, 111, 143, 231, 259, 273, 407, 429, 481, 777, 1001, 1221, 1443, 2849, 3003, 3367, 5291, 8547, 10101, 15873, 37037, 111111):
    print(6)
elif K in (239,4649,239*4649):
    print(7)
else:
    print(-1)
# Judge status: Accepted
tmp = input()
line = input().split(" ")
for i in range(len(line)):
  line[i] = int(line[i])
line.sort()
count = 0
for i in range(0, len(line) - 2):
  for j in range(1, len(line) - 1):
    if i > j or i == j:
      continue
    for k in range(2, len(line)):
      if j > k or j == k:
        continue
      if int(line[i]) != int(line[j]) and int(line[j]) != int(line[k]):
        if int(line[i]) + int(line[j]) > int(line[k]):
          count += 1
print(count)
# Judge status: Accepted
def kai(n):
    a=""
    for i in reversed(range(len(n))):
        a+=(n[i])
    if n==a:
        return True

a,b=input().split()
cnt=0
for i in range(int(b)-int(a)+1):
    if kai(str(int(a)+i)):
        cnt+=1

print(cnt)
# Judge status: Accepted
import math
a,b,h,m = map(int, input().split())

h_angle = 30*h + 0.5*m
m_angle = 6*m
diff_angle = abs(h_angle - m_angle)

if diff_angle > 180:
    diff_angle = 360 - diff_angle

cosC = math.cos(math.radians(diff_angle))
x = a**2 + b**2 - 2*a*b*cosC
ans = math.sqrt(x)
print(ans)
# Judge status: Accepted
k = 10**9
x, y = divmod(-int(input()), k)
print(0, 0, 1, k, -x, y)
# Judge status: Accepted
N = input()
K = input()
X = input()
Y = input()
if K < N:
    print K * X + (N - K) * Y
else:
    print N * X
# Judge status: Accepted
import math

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

if a%b == 0:
    ans = a
elif b%a == 0:
    ans = b
else:
    ans = int(a*b / math.gcd(a, b))

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

prices = [1]
idx = 1
while 6 ** idx <= N:
    prices.append(6 ** idx)
    idx += 1
idx = 1
while 9 ** idx <= N:
    prices.append(9 ** idx)
    idx += 1

prices.sort()

dp = [float('inf') for _ in range(N + 1)]
dp[0] = 0
for n in range(N + 1):
    for price in prices:
        dp[n] = min(dp[n], dp[n - price] + 1)

print(dp[-1])
# Judge status: Wrong Answer
d, n = map(int, input().split())
print(int(str(n) + str(100**d).replace("1", "")))
# Judge status: Wrong Answer
n=int(input())
s=input()
ans=[]
for i in range(len(s)):
    num=ord(s[i])+n
    if num>90:
        num-=25
    ans.append(chr(num))
ans="".join(ans)
print(ans)
# Judge status: Accepted
A,B=map(int,input().split())

for i in range(1,B+1):
    if A*i % B == 0:
        print(A*i)
        break
# Judge status: Accepted
a,b  = map(int, input().split())

cnt = 0
for i in range(a,b+1):
    s = str(i)
    if s[0] == s[-1] and s[1] == s[-2]:
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
n = int(input())
s = list(int(input()) for i in range(n))

s.sort()

ans = sum(s)

if ans % 10 != 0:
    print(ans)
    exit()
else:
    tmp = ans
    for x in s:
        ans -= x
        if ans %10 != 0:
            print(ans)
            exit()
print(0)
# Judge status: Wrong Answer
import math
N, K = map(int, input().split())
h = list(map(int, input().split()))
 
S = [0] * N
S[0] = 0
 
for i in range(1, N):
    value = math.inf
    for step in range(1, i + 1):
        value = min(value, S[i - step] + abs(h[i] - h[i - step]))
    S[i] = value
print(S[N - 1])
# Judge status: Accepted
a, b = map(int, input().split())
if a>=0 and b>=0:
    print('Positive')
elif 0>b:
    if (b-a+1)%2==0:print('Positive')
    else:print('Negative')
elif a<=0<=b:
    print('Zero')
else:
    pass
# Judge status: Accepted


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    S = read_int() # 10^18
    # X <= 10^9
    # 10**9*Y3-X3=S
    low, high = 0, 10**9
    while high-low > 1:
        mid = low+(high-low)//2
        if 10**9*mid >= S:
            high = mid
        else:
            low = mid
    Y3 = high
    X3 = 10**9*Y3-S
    return 0, 0, 10**9, 1, X3, Y3


if __name__ == '__main__':
    print(*solve())
# Judge status: Accepted
s=input()
if s=="ABC":
	print("ARC")
else:
	print("ABC")
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

p = A[0]
for i in range(1, n):
    p ^= A[i]

for i in range(n):
    print(p^A[i])
# Judge status: Accepted
n, m = map(int, input().split())

if m >= n:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
from collections import defaultdict
d=defaultdict(int)
for a in A:
    d[a]+=1
print(['NO','YES'][all([1 if x==1 else 0 for x in d.values()])])
# Judge status: Wrong Answer
import sys
a,b,c,d=map(int,input().split())
if b>=c :
	print(b-c)
else :
	print("0")
# Judge status: Wrong Answer
x,y,z=map(int,input().split())
s=0
c=0
i=0
while(s<z+0.5):
    c+=y
    i+=x
    s+=i
print(c)
# Judge status: Accepted
import itertools

import math
n, l = map(int, input().split())
l_list = []
abs_list = [0]*n

for i in range(0, n):
    l_list.append(l + i)

min_tmp = 10**9
mini = 0
for i in range(0, n):
    if(abs(l_list[i]) <= min_tmp):
        min_tmp = abs(l_list[i])
        mini = l_list[i]
print(sum(l_list) - mini)
# Judge status: Accepted
n = str(input())
if str.isupper(n) == True :
  print("A")
else:
  print("a")
# Judge status: Wrong Answer
S = input()
T = input()

cnt = 0
for i in range(len(S)):
    if S[i] != T[i]:
        cnt += 1
    else:
        cnt = cnt

if cnt%2 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())

# 合計値
x = 0

# 組み合わせパターン
count = 0

for a in range(A + 1):
    x = a * 500
    for b in range(B + 1):
        x = a * 500 + b * 100
        for c in range(C + 1):
            x = a * 500 + b * 100 + c * 50
            if x == X:
                count += 1
print(count)
# Judge status: Accepted
n,a,b = map(int,input().split())
mod = 10**9+7
ans = pow(2,n,mod) - 1 
mod_inv = [0, 1] + [0] * (b+3)
for i in range(2, b+5):
    mod_inv[i] = - mod_inv[mod % i] * (mod // i) % mod
def comod(n, r, mod):
    ans = 1
    for i in range(r):
        ans *= (n-i) % mod
        ans *= mod_inv[i+1]
        ans %= mod
    return ans
ans -= comod(n,a,mod) + comod(n,b,mod)
print(ans % mod)
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n <= k:
  print(x*n)
else:
  print(x*k+y*(n-k))
# Judge status: Accepted
def Csum(a):
    b,c=[0],0
    for i in range(len(a)):
        c+=a[i]
        b.append(c)
    return b
n,k=map(int,input().split())
p=Csum(list(map(int,input().split())))
ans=0
for i in range(n-k+1):
    ans=max(ans,p[i+k]-p[i])
print((ans+k)/2)
# Judge status: Accepted
def primes(n):
    is_prime = [0] * (n + 1)
    is_prime[0] = 0
    is_prime[1] = 1
    for i in range(2, n+1):
        for j in range(i, n + 1, i):
            is_prime[j] += j
    return sum(is_prime)
    
n = int(input())
ans = 0
print(primes(n)+(n*(n+1)//2)-1)
# Judge status: Accepted
c = input()

if c == 'a' or c == 'i' or c == 'u' or c == 'e' or c == 'o':
    print('vowel')
else:
    print('consonant')
# Judge status: Accepted
n = int(input())
ans = n * (n-1) // 2
print(ans)
# Judge status: Wrong Answer
N, L = map(int, input().split())
A = list(range(1, N+1))
ans = 0
saisyo = float("inf")
saidai = -float("inf")
for i in range(N):
    x = A[i] + L-1 
    saisyo = min(x, saisyo)
    saidai  = max(x, saisyo)
    ans += x
if saisyo >=0:
    print(ans-saisyo)
else:
    print(ans-saidai)
# Judge status: Accepted
N = int(input())
A = [int(input()) for j in range(N)]

B = sorted(A)
a = B[-1]
b = B[-2]
c = A.index(a)
for j in range(N):
    if j == c:
        print(b)
        continue
    print(a)
# Judge status: Accepted
from collections import Counter

MOD = 998244353

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

d_count = Counter(d)

ans = 1
pre_count = 1

if d[0] > 0: ans = 0

for i,(dist,count) in enumerate(sorted(d_count.items())):
    if i != dist or (i==0 and count > 1):
        ans = 0
        break
    
    ans *= pow(pre_count,count,MOD)
    ans %= MOD
    
    pre_count = count
    
print(ans)
# Judge status: Accepted
h = input()

result = 'Yes'

if len(h)%2 != 0:
  result ='No'
  
for a in range(0,len(h)-1,2):  
  b = h[a:a+2]
  if b != 'hi':
    result = 'No'
    break
    
print(result)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
if (b - a) % 2 == 0:
    print(int((b - a) / 2))
elif b - a == 1:
    print(min(a - 1, n - b) + 1)
else:
    if a == 1 or b == n:
        print(int((b - a - 1) / 2 + 1))
    else:
        if a - 1 <= n - b:
            print(int(a + ((n - b - a - 1) / 2)))
        else:
            print(int(n - b + 1 + ((b - a - 1) / 2)))
# Judge status: Accepted
x = int(input())
t = (-1+(1+8*x)**0.5)/2-0.00001
print(int(t)+1)
# Judge status: Wrong Answer
n,x=map(int,input().split())
xlist= list(map(int,input().split()))
xlist.append(x)
xsort = sorted(xlist, reverse=True)
if n == 1:
  print(xsort[0]-xsort[1])
  exit()
ylist = []
for i in range(n-1):
  ylist.append(xsort[i]-xsort[i+1])
from functools import reduce
from math import gcd
print(reduce(gcd,ylist))
# Judge status: Accepted
s = list(input())
if len(set(s)) == 3:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
S = input()

if S == 'RSS':
    print(1)
    exit()

tmp = 0
for i in range(len(S)):
    if S[i] == 'R':
        tmp += 1
    else:
        if i == 2:
            break
        else:
            tmp = 0
print(tmp)
# Judge status: Accepted
x,y = map(int,input().split())

ans = 0
while True:
    if x <= y:
        ans += 1
        x *= 2
    else:
        break
print(ans)
# Judge status: Accepted
import math
from decimal import *

arr = []
n = int(input())
for _ in range(n):
    arr.append(list(map(int, input().split())))
dp = [[0 for i in range(3)] for i in range(n)]
dp[0][0] = arr[0][0]
dp[0][1] = arr[0][1]
dp[0][2] = arr[0][2]
for i in range(1, n):
    for j in range(3):
        for x in range(3):
            if(x!= j):
                dp[i][j] = max(arr[i][j]+ dp[i-1][x], dp[i][j])
ans = max(dp[n-1][0], dp[n-1][1], dp[n-1][2])
print(ans)
# Judge status: Accepted
def solve():
    N, K  = map(int, input().split())
    H = sorted([int(input()) for _ in range(N)])
    ans = float("inf")
    for i in range(N-K+1):
        ans = min(ans, H[i+K-1]-H[i])
    print(ans)

if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, K = map(int, input().split())
lst = list(range(N + 1))

MOD = 10 ** 9 + 7

small = sum(lst[:K-1])
big = sum(lst[-(K-1):])

ans = 0
for i in range(K, N + 2):
    small += lst[i-1]
    big += lst[-i]

    ans += big - small + 1
    ans %= MOD

print(ans)
# Judge status: Wrong Answer
A, B, K = map(int, input().split())
a=[]
b=[]
for i in range(A, A+K):
    a.append(i)
for i in range(B-K+1, B+1):
    b.append(i)
c=sorted(set(a)|set(b))
for i in c:
    print(i)
# Judge status: Wrong Answer
a=int(input())
b=int(input())
h=int(input())
print("(a+b)*h/2)")
# Judge status: Accepted
s = int(input())
lst = list(map(int,input().split()))
lst.sort()

if lst[-1] < sum(lst[:-1]):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys
K = int(input())
A, B = map(int, input().split())

#print(K)
#print(A)
#print(B)

for num in range(A, B):
  print(num)
  if num % K == 0:
    print("OK")
    sys.exit()


print("NG")
# Judge status: Wrong Answer
n = int(input())

s = list(map(str,input().split()))

e = s.count("E")
w = n - e

if e >= w:
    print(w)
else:
    print(e)
# Judge status: Accepted
def main():
	n = int(input())
	a = tuple(map(int,(input().split())))
	b = tuple(map(int,(input().split())))

	li = list(range(1,n+1))

	import itertools
	p = list(itertools.permutations(li))

	print(abs(int(p.index(a)) - int(p.index(b))))

	
 
if __name__ == '__main__':
	main()