peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n, x = map(int, input().split())
a = list(map(int, input().split()))

a.sort()

cnt = 0
for i in range(n):
    if i == n - 1:
        if x == a[i]:
            cnt += 1
    elif x >= a[i]:
        x -= a[i]
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
N,A,B = map(int, input().split())
if (B-A)%2==0:
    print((B-A)//2)
else:
    print(min(N-B, A))
# Judge status: Accepted
#!/usr/bin/env python3
x,y ,z= map(int,input().split())
print(z,x,y)
# Judge status: Accepted
l, r, d = map(int, input().split())

ans = 0
for i in range(l, r+1):
    if i%d==0:
        ans += 1
print(ans)
# Judge status: Accepted
import re

N, A, B, C, D = map(int, input().split())
S = input()
S = '#' + S
flag = True
if re.search(r'##', S[min([A,B]): max([C,D])+1]):
    flag *= False

if D < C:
    if re.search(r'\.\.\.', S[B-1:D+2]):
        flag *= True
    else:
        flag *= False
        
print('Yes') if flag else print('No')
# Judge status: Wrong Answer
A, B, C, D = map(int, input().split())

if A<=C and D<=B: print(D-C)

if C<=A and B<=D: print(B-A)


if (A<=C and C<= B and B<=D): print(B-C)

if C<=A and A<=D and D<=B: print(B-A)

if B<=C or D<=A: print(0)
# Judge status: Accepted
import math
a,b=map(int,input().split())
m=max(math.ceil(100*a/8),math.ceil(100*b/10))
if a<=m*8/100<a+1 and b<=m*10/100<b+1:
    print(m)
else:
    print(-1)
# Judge status: Accepted
a=[]
for i in range(6):
    a.append(int(input()))
if a[4]-a[0]>a[5]:
    print(":(")
else:
    print("Yay!")
# Judge status: Wrong Answer
print(1) if int(input()) == 0 else print(1)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(k):
	im = [0 for _ in range(n+1)]
	for i, x in enumerate(a):
		im[max(i-x, 0)] += 1
		im[min(i+x+1, n)] -= 1
	nxt = [im[0]]
	for i in range(1, n):
		nxt.append(nxt[-1] + im[i])
	a = nxt
	if min(a) == n:
		break

print(*a)
# Judge status: Accepted
n=int(input())
l=[[0]*10for _ in range(10)]
for x in range(1,n+1):l[int(str(x)[0])][int(str(x)[-1])]+=1
print(sum(l[i][j]*l[j][i]for i in range(10)for j in range(10)))
# Judge status: Wrong Answer
a,b=map(int,input().split())

if a>=b:

    print(str(a)*b)
else:
    print(str(b)*a)
# Judge status: Accepted
N,M = map(int,input().split())
s,c=[],[]
for _ in range(M):
    s_,c_ = map(int,input().split())
    s.append(s_)
    c.append(c_)

if N != 1:
    a,b=10**(N-1),10**N
else:
    a,b=0,10

for i in range(a,b):
    ok = True
    num = str(i)
    for k in range(M):
        if num[s[k]-1] != str(c[k]):
            ok = False
    if ok:
        print(i)
        exit()
print(-1)
# Judge status: Accepted
# -*- coding: utf-8 -*-
def conv(a): #convert the num to character
  a += 97
  return chr(a)

# 整数の入力
n = int(input())
name = ''

while n>0:
  n -= 1
  name += conv(n%26)
  n //= 26

# 出力
print(name[::-1])
# Judge status: Accepted
s = input()
if int(s[:4]) <= 2019:
    if int(s[5:7]) <= 4:
        if int(s[8:]) <= 30:
            print("Heisei");exit()
print("TBD")
# Judge status: Accepted
import numpy as np
N = int(input())
city_num = {}
score = []

for i in range(N):
    s, p = input().split()
    if s not in city_num.keys():
        city_num[s] = [i]
    else:
        city_num[s].append(i)
    score.append(int(p))
    
score_rank = np.argsort(score)[::-1]  
city_num = sorted(city_num.items())

for city, num in city_num:
    order = [s for s in score_rank if s in num]
    [print(o + 1) for o in order]
# Judge status: Accepted
a, b = input().split()
print(b+a)
# Judge status: Wrong Answer
A, B = map(int, input().split())

tmp = A
ans = 1
while tmp < B:
    tmp *= 2
    if tmp < B:
        ans += 1
print(ans)
# Judge status: Wrong Answer
s=input()
if(s=="sunny"):
  print("cloudy")
elif(s=="cloudy"):
  print("rainy")
else:
  print("sunny")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
m=max(a)
l=[0for i in range(m+1)]
for i in range(n):
 for j in range(a[i], m + 1, a[i]):l[j] += 1
c=0
for i in range(n):
 if l[a[i]] == 1:c += 1
print(c)
# Judge status: Wrong Answer
a, b, c, k = map(int, input().split())

ans = abs(b - a) * (-1) ** (k%2 + 1)
if abs(ans) >= 1000000000000000000:
    print("Unfair")
else:
    print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
for i in range(1, 100000):
    if a*i % b == c:
        print("YES")
        exit()
print("NO")
# Judge status: Accepted
n = int(input())
a = {int(i*1.08):i for i in range(1, 5*10**4+1)}
if n in a:
    print(a[n])
else:
    print(':(')
# Judge status: Accepted
s = input()
count = 0
for i in range(len(s)//2):
    if s[i] != s[-i-1]:
        count += 1
print(count)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np


def main(n, x, a):
  cnt = 0
  for j, i in enumerate(a):
    x -= i
    if x < 0:
      break
    elif j == n-1 and x > 0:
      break
    cnt += 1
  return cnt

n, x = map(int, readline().split())
a = np.sort(np.array(readline().split(), np.int64))
print(main(n, x, a))
# Judge status: Accepted
def solve(n):
	if n == 0:
		return True
	if n < 0:
		return False
	return (False or solve(n-4) or solve(n-7))

n = int(input())
print('Yes' if solve(n) else 'No')
# Judge status: Wrong Answer
sizePrice = list(map(int, input().split()))
N = int(input())
perL = [sizePrice[0] * 4, sizePrice[1] * 2, sizePrice[2], sizePrice[3] / 2]
ans = 0
if N % 2 == 0:
    ans = int(min(perL)) * (N // 2)
else:
    ans = int(min(perL)) * (N - 1)
    ans += min(perL[:-1])
print(ans)
# Judge status: Wrong Answer
N = input()
S = list(map(int,input().split()))
 
max=S[0];
 
semimax=S[1];
 
val=max;
 
for i in range(int(N)-2):
	val+=semimax
	if S[i+1]>max:
		max=S[i+1]
		if S[i+1]>semimax:
			semimax=S[i+1]

print(val)
# Judge status: Accepted
n,m = map(int, input().split())
link = [[] for _ in range(n)]
for i in range(m):
    a,b = list(map(int,input().split()))
    link[a-1].append(b-1)
    link[b-1].append(a-1)

from collections import deque
Q = deque()
Q.append([0,0])

visited=[-1]*n
visited[0]=1

while Q:
    now,cnt = Q.popleft()
    for nxt in link[now]:
        if visited[nxt]!=-1:
            continue
        visited[nxt]=now+1
        Q.append([nxt,cnt+1])

print("Yes")
for a in visited[1:]:
    print(a)
# Judge status: Accepted
N, M = map(int, input().split())

Ps = [[] for i in range(N)]
Cs = []
for i in range(M):
    p, y = map(int, input().split())
    p -= 1
    Cs.append([p, 0])
    Ps[p].append([i, y])

for p in Ps:
    p = sorted(p, key=lambda city: city[1])
    for i in range(len(p)):
        Cs[p[i][0]][1] = i+1

for i in range(M):
    print('{:0=6}{:0=6}'.format(Cs[i][0]+1, Cs[i][1]))
# Judge status: Accepted
# -*- coding: utf-8 -*-

#----------
a,b,c = list(map(int, input().rstrip().split()))
#----------
if (b-a) == (c-b):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
ln = list(input())
for i in ln:
    if i == "7":
        print("Yes")
        exit()
print("No")
# Judge status: Accepted
a,b=map(int,input().split())
if a<=8 and b<=8:
  print('Yay!')
else:
  print(":(")
# Judge status: Accepted
from bisect import bisect_right

def main():
    n, k = map(int, input().split())
    x = [int(i) for i in input().split()]
    o = bisect_right(x, 0)
    ans = 10**9
    for i in range(max(o - k, 0), min(o, n - k) + 1):
        a, b = x[i], x[i + k - 1]
        c, d = abs(a), abs(b)
        if a * b > 0:
            ans = min(max(c, d), ans)
        else:
            ans = min(min(c, d) * 2 + max(c, d), ans)
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
n, T = map(int, input().split())
a = 1001
for _ in range(n):
    c, t = map(int, input().split())
    if t <= T and c < a:
        a = c
if a == 1001:
    print('TLE')
else:
    print(a)
# Judge status: Accepted
import math

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

r = max(As)

if K == 0:
  print(r)
  exit()
  
l = 1

while l < r:
  mid = (r + l)//2
  cnt = 0
  for a in As:
    cnt += math.ceil(a/mid) - 1
  if cnt <= K:
    r = mid
  else:
    l = mid + 1
  
print(r)
# Judge status: Accepted
a,b = map(int,input().split())
ans = 0

for x in range(b+1):
  if x > a:
    break
  for y in range(b+1):
    if y > a:
      break
    z = b-x-y
    if z <= a and z >= 0:
      ans +=1
    else:
      continue  
print(ans)
# Judge status: Accepted
X,Y = map(int,input().split())
ans = 'No'
for a in range(X+1):
    for b in range(X+1):
        if a + b == X and 2*a + 4*b == Y:
            ans = 'Yes'
print(ans)
# Judge status: Accepted
s=sorted(list(input()))
if s[0]==s[-1]:
  print(0)
else:
  a=s.index('1')
  print(2*min(a,len(s)-a))
# Judge status: Wrong Answer
x, a, b = map(int, input().split())

if x - a < x - b:
  print("A")
else:
  print("B")
# Judge status: Accepted
n = int(input())
a_list = [int(input()) for nesya in range(n)]
s = sorted(a_list,reverse=True)
max1 = s[0]
max2 = s[1]
for a in a_list:
  if a == max1:
    print(max2)
  else:
    print(max1)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

ans = [a * c, a * d, b * c, b * d]
print(max(ans))
# Judge status: Wrong Answer
n = int(input())
s = [input() for _ in range(n)]
import collections
c = collections.Counter(s)
d = c.most_common()
e = [d[0][0]]
for i in range(len(d)-1): #nじゃない　dの長さ
   if d[0][1] == d[i+1][1]:
      e.append(d[i+1][0])       #辞書順にする
e.sort()
print(repr(e))   #print(repr(e))でもいける？
# Judge status: Accepted
w, a, b = [int(x) for x in input().split()]
ans = 0
if a + w < b:
    ans = b - (a + w)
elif b + w < a:
    ans = a - (b + w)
print(ans)
# Judge status: Accepted
#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    ret = 10**9
    for a in range(1,N):
        b = N-a
        ret = min(ret,sum(map(int,list(str(a))))+sum(map(int,list(str(b)))))

    print(ret)

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
abc = []
ans = 0

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

minabc = min(abc)
ans += n//minabc
if n % minabc != 0:
    ans += 1

if minabc >= n :
    print(5)
else :
    print(4 + ans)
# Judge status: Wrong Answer
import math

x = int(input())
uba = math.ceil(x**0.2) # ルート1/5

flag = False
for a in range(-uba-1, uba+1):
    for b in range(-uba-1, uba+1):
        s = a**5 - b**5
        if s == x:
            flag = True
            break
    if flag:
        break

print(a, b)
# Judge status: Accepted
# AGC002 B Box and Ball

n, m = map(int, input().split())

b_list = [0] * (n+1)
b_list[1] = 1
c_list = [1] * (n+1)

for i in range(m):
    _x, _y = map(int, input().split())
    c_list[_x] -= 1
    c_list[_y] += 1 
    if b_list[_x] == 1:
        b_list[_y] = 1
        if c_list[_x] == 0:
            b_list[_x] = 0

print(sum(b_list))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
ans = []
a.sort(reverse=True)
key = a[0]
i = 1
while True:
    if len(ans) == 2:
        break
    if a[i] == key:
        i += 2
        ans.append(key)
        if i > n-1:
            break
        key = a[i]
    else:
        i += 1
        if i > n-1:
            break
        key = a[i]
if len(ans) != 2:
    print(0)
else:
    print(ans[0]*ans[1])
# Judge status: Wrong Answer
x = int(input())
t = int(x ** 0.5)
min_d = t * (t + 1) * 0.5
if min_d == x:
  print(t)
else:
  if min_d + t + 1 == x:
    print(t+1)
  elif min_d + t + 1 < x:
    print(t + 2)
  else:
    print(t + 3)
# Judge status: Accepted
def main():
    N, A, B = map(int, input().split())
    if A > B:
        return 0
    if N == 1:
        if A != B:
            return 0
        else:
            return 1
    if N == 2:
        return 1

    mn = A * (N - 1) + B
    mx = A + B * (N - 1)
    return mx - mn + 1


if __name__ == "__main__":
    print(main())
# Judge status: Accepted
N = int(input())
A = [int(a) for a in input().split()]

M = 10**6+1
L = [0]*M

for a in A:
    if L[a] >= 1:
        L[a] = 2
        continue
    L[a] = 1
    i = 2
    while a*i < M:
        L[a*i] = 2
        i += 1

ans = 0
for a in A:
    if L[a] == 1:
        ans += 1
print(ans)
# Judge status: Accepted
K, X = map(int, input().split())
print(' '.join(map(str, range(X - K + 1, X + K))))
# Judge status: Accepted
A,B,C = map(int, input().split())
print("Yes" if A<=C and C<=B else "No")
# Judge status: Accepted
n=int(input())
if n%2==1:
  print(0)
  exit(0)
n=n//2
i=0
f=5

while (n//f)>0:
  i+=n//f
  f=f*5

i+=n//f
print(i)
# Judge status: Accepted
a,b = map(int,input().split())
ten = []
ei = []
for i in range(1,1010):
    if a <= i*0.08 < a+1:
        ei.append(i)
for j in range(1,1010):
    if b <= j*0.1 < b+1:
        ten.append(j)
case = set(ei) & set(ten)
if not case:
    print(-1)
else:
    print(min(case))
# Judge status: Accepted
A=[]
B=[False]*9
for i in range(3):
  A+=[int(i) for i in input().split()]
n=int(input())
for _ in range(n):
  b=int(input())
  for i in range(9):
    if b==A[i]:
      B[i]=True
C=[[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]]
Chk=False
for a,b,c in C:
  if B[a-1] and B[b-1] and B[c-1]:
    Chk=True
print("Yes" if Chk else "No")
# Judge status: Wrong Answer
n=int(input())
a=-(-n//10**9)
b=10**9*a-n
print(0,0,10**9,1,a,b)
# Judge status: Accepted
S = list(input())
a = 0
b = 0
c = 0

for s in S:
    if s == 'a':
        a += 1
    elif s == 'b':
        b += 1
    else:
        c += 1

if max(a, b, c) - min(a, b, c) < 2:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
a, b, c = list(map(int, input().split()))
answer = 'NO'

def hantei(a, b, c):
    if a == 1:
        return 'YES'

    if b % 2 == 0 and c % 2 == 0:
        return 'YES'

    if b % 2 == 0 and c % 2 == 1:
        # 総和が奇数
        if a % 2 == 0:
            return 'NO'
    return 'YES'

print(hantei(a, b, c))
# Judge status: Wrong Answer
#104B
s = "AtCoder"
c_list = []
c_count = 0
answer = "WA"
for i in range(2,len(s)):
    if s[i] == "C":
        c_list.append(i)
    if s[i].islower() == False:
        c_count += 1
if s[0]=="A" and s[1].islower()==True and len(c_list)==1 and c_count==1:
    answer="AC"
print(answer)
# Judge status: Accepted
W, H, x, y = map(int, input().split())
s = 0
if W == 2*x and H == 2*y:
  s = 1
S = W*H/2
print(S, s, sep =' ')
# Judge status: Wrong Answer
def sep(n,mod):
	r = 1
	if n == 1:
		return 1
	if n == 2:
		return mod+1
	for i in range(mod):
		r += sep(n-1,mod-i)
	return r
	

s = int(input())
n = s//3
mod = s%3
count = 0
while n != 0:
	if mod == 0 or n == 1:
		count += n**mod
	else:
		count += n**mod - int((mod*(mod-1))/2)
	#count += sep(n,mod)
	mod += 3
	n -= 1
print(count%((10**9)+7))
# Judge status: Wrong Answer
n=int(input())
s=input()

if len(s)%2!=0:
  print('No')
else:
  if s[len(s)//2]==s[len(s)//2+1:]:
    print('Yes')
  else:
    print('No')
# Judge status: Wrong Answer
n = int(input())
a = int(input())

tmp = n % 500

if tmp <= n:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
s = input()

ans = 0
for i in range(1,n+1) :
    l = set(s[:i])
    r = set(s[i:])
    ans = max(ans,len(l&r))

print(ans)
# Judge status: Wrong Answer
H, W = input().split()
H = int(H)
W = int(W)
result = (W + 1)/2
if H % 2 == 0:
    even_row = H / 2
else:
    even_row = (H-1)/2
odd_row = H - even_row
result2 = (result-1)*even_row
result1 = result*odd_row
print(result1+result2)
# Judge status: Accepted
import heapq 

N,M=map(int,input().split())
A=[-a for a in list(map(int,input().split()))]
heapq.heapify(A)
for _ in [0]*M:
    a=heapq.heappop(A)
    heapq.heappush(A,-((-a)//2))
    
res=0
for i in range(N):
    a=heapq.heappop(A)
    res+=-a
print(res)
# Judge status: Accepted
S = input()
T = "keyence"
for i in range(len(S)):
    for j in range(len(S)):
        if S[:i] + S[j:] == T:
            print('YES')
            exit()
print('NO')
# Judge status: Accepted
N = int(input())
rate = list(map(int,input().split()))
rate.append(100)
position = 0
flag = 'motanai'
money = 1000
for i in range(N):
  if flag == 'motanai' and rate[i]<rate[i+1]:
    position = money//rate[i]
    money = money%rate[i]
    flag = 'motu'
  elif flag == 'motu' and rate[i]>rate[i+1]:
    money += position*rate[i]
    position = 0
    flag = 'motanai'
  else:
    continue
print(money)
# Judge status: Accepted
n=int(input())
c=list(input())
for i in range(n-1):
    t=[]
    s=list(input())
    for j in c:
        if j in s:
            t.append(j)
            s.remove(j)
    c=t
c.sort()
print("".join(c))
# Judge status: Accepted
from collections import Counter
ns = Counter([int(i) for i in input().split()])
if ns[5] == 2 and ns[7] == 1:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
s = input()
ss = []
count = 0
for x in range(len(s)):
  ss.append(int(s[x]))
#print(ss)
for x in range(1,len(s)):
  if ss[x-1] == 0:
    ss[x] = 1
    count += 1
  else:
    ss[x] = 0

      
#print(ss)
print(count)
# Judge status: Accepted
import sys
import math
import bisect

def main():
    s = input()
    t = input()
    if s == t[::-1]:
        print('YES')
    else:
        print('NO')
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())

ans = 0

if N == 1:
    print(1)
    exit()
if N == 2:
    print(5)
    exit()
if N == 3:
    print(11)
    exit()

for i in range(1, N//2+2):
    last = N//i
    ans += ((1+last) * last // 2 * i)

ans += (N//2+2 + N) * (N - N//2 - 1) // 2

print(ans)
# Judge status: Accepted
import fractions
N = int(input())
A = [int(i) for i in input().split()]
def lcm(a,b):
  return a*b//fractions.gcd(a,b)
a_lcm = A[0]
for a in A[1:]:
  a_lcm = lcm(a_lcm, a)
ans = 0
for a in A:
  ans += a_lcm//a
print(ans%(10**9+7))
# Judge status: Wrong Answer
a,b,c,x,y = map(int,input().split())
A_B = a*x+b*y
A_AB = a*x+2*c*y
AB_B = 2*c*x+b*y
AB = 2*c*max(x,y)
ans = min(A_B,A_AB,AB_B,AB)
print(ans)
# Judge status: Wrong Answer
N=int(input())
ans=0
for i in range(0,N):
    if 2**i>N:
        ans=2**(i-1)
        break
    else:
        continue
print(0 if N==1 else ans)
# Judge status: Wrong Answer
N,M = map(int,input().split())
A = ['a']*N
for _ in range(M):
  s,c = map(int,input().split())
  if A[s-1] !='a' and A[s-1] != c:
    print(-1)
    exit()
  else:
    A[s-1] = c

for i in range(N):
  if A[0] == 'a' and N==3:
    A[0] = 1
  elif A[i] == 'a':
    A[i] = 0
Answer = ''.join(map(str,A))

if Answer != '0' and len(Answer) != N:
  Answer = -1
if Answer == '000':
  Answer = -1
print(Answer)
# Judge status: Accepted
N,K=map(int,input().split())
L=list(map(int,input().split()))
    
import math
MAX=10**9
MIN=0
for i in range(100):
    Mid=(MAX+MIN)/2
    cnt=0
    for j in range(N):
        cnt+=L[j]//Mid
    if cnt<=K:
        MAX=Mid
    else:
        MIN=Mid
    #print(cnt)
print(math.ceil(Mid))
# Judge status: Accepted
n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]

ans=0
for i in set(s):
    ans=max(s.count(i)-t.count(i),ans)
print(ans)
# Judge status: Accepted
a, b, t = map(int, input().split())
print(int((t+0.5)//a*b))
# Judge status: Accepted
N = int(input())
D = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(N)]
for i in range(1, N + 1):
  t = D[i][0] - D[i - 1][0]
  d = D[i][1] - D[i - 1][1] + D[i][2] - D[i - 1][2]
  if (t < d) or (t % 2 != d % 2):
    print('No')
    break
else:
  print('Yes')
# Judge status: Wrong Answer
s = input()
a = sorted(s)
print("Yes" if a[0]==a[1] and a[2]==a[3] else "No")
# Judge status: Accepted
h,a = map(int,input().split())

if h%a==0:
  print(h//a)
else:
  print(h//a+1)
# Judge status: Accepted
i = list(map(int, input().split()))

ws = i[0]
cs1 = i[1]
cs2 = i[1]
t = i[2]
n = 1
while ws > cs1:
    n += 1
    cs1 += cs2
tt = n * t
print(tt)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]

cnt = 0
remain = 0
for a in A:
    if a == 0:
        remain = 0
        continue
    cnt += (a+remain)//2 
    remain = (a+remain)%2
print(cnt)
# Judge status: Accepted
a, b, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xyc = [list(map(int, input().split())) for _ in range(m)]

ans = float('inf')

for x, y, c in xyc:
    ans = min(ans, a[x-1] + b[y-1] - c)

print(min(min(a) + min(b), ans))
# Judge status: Wrong Answer
a, b = map(int, input().split())

c = (a*b)%2

if c == 0:
  print("even")
  
else:
  print("odd")
# Judge status: Accepted
N, A, B = map(int, input().split())
S = input()

n_pass = 0
n_overseas = 0
for s in S:
  if s == "a":
    if n_pass < A+B:
      print("Yes")
      n_pass += 1
    else:
      print("No")
  elif s == "b":
    if n_pass < A+B and n_overseas < B:
      print("Yes")
      n_pass += 1
      n_overseas += 1
    else:
      print("No")
  else:
    print("No")
# Judge status: Wrong Answer
N, M = map(int, input().split())
ab = []
for i in range(M):
    a, b = map(int, input().split())
    if a == 1 or b == N:
        ab.append([int(a), int(b)])

flag = False
for i in range(len(ab)):
    for k in range(len(ab)-i):
        if len(list(set(ab[i])&set(ab[k])))==1:
            print('POSSIBLE')
            flag = True
            break
    if flag:
        break
else:
    print('IMPOSSIBLE')
# Judge status: Wrong Answer
s = list(input())
start = 0
end = 0
for i in range(len(s)):
  if s[i] == "A":
    start = i
for i in reversed(range(len(s))):
  if s[i] == "Z":
    end = i
print(end - start + 1)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
ans = []
max_length = len('{:b}'.format(max(a)))
for i in range(n):
    bit = '{:b}'.format(a[i]).rjust(max_length, '0')
    num = 0
    for j in range(max_length):
        if bit[j] == '0':
            num += pow(2, max_length - j - 1)
    ans.append(num)
for i in range(n):
    print(ans[i])
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))

count=0
for n in A:
    if (n % 2) == 0:
        count += 1
        if (n % 3) != 0 and (n % 5) != 0:
            print("DENIED")
            exit()

if count == 0:
    print("DENIED")
else:
    print("APPROVED")
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
sm=sum(a)
i=0
han=0

while sm/2>han:
  if i==n-1:
    break
  han+=a[i]
  i+=1
nhan=sm-han

print(abs(han-nhan))
# Judge status: Accepted
import numpy as np
N, K = map(int, input().split())
X = np.array(list(map(int, input().split())))
idx = np.searchsorted(X, 0)
# print('idx', idx)
ans = 10**10
for i in range(N - K + 1):
    l = i
    r = i + K - 1
    d1 = np.abs(X[l]) + np.abs(X[r] - X[l])
    d2 = np.abs(X[r]) + np.abs(X[r] - X[l])
    d = min(d1, d2)
    ans = min(ans, d)
print(ans)
# Judge status: Wrong Answer
X = int(input())

for a in range(-5, 5):
  for b in range(-5, 5):
    #print(a,b)
    if a**5 - b**5 == X:
      print(a, b)
      exit()
# Judge status: Wrong Answer
S = input()

if S == "AAA" or S == "BBB":
  print("no")
  
else:
  print("yes")
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
if A <= C <= B and A >= B >= C:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    m = max(a)
    s = sorted(a)[1]
    for i in a:
        if i == m:
            print(s)
        else:
            print(m)

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

if s == t:
  print(n)
  exit()

ss = s+t
ans = ''
slen = len(s)
for i in range(slen):
  k = slen - i -1
  l = slen + i
  if ss[k] == ss[l]:
    ans = ss[:k]+ss[l:]

if len(ans) == 0:
  print(len(ss))
else:
  print(len(ans))
# Judge status: Accepted
N = int(input())
S = []
for i in range(N):
    s = str(input())
    S.append(s)

S = set(S)
print(len(S))
# Judge status: Accepted
X, K, D = map(int, input().split())
x = abs(X)
if X == 0:
    cnt = K
    if cnt % 2 == 0:
        ans = 0
    else:
        ans = D
elif x >= D:
    cnt = K - x//D
    if x- K*D >= 0:
        ans = x - K*D
    elif x - K*D < 0 and cnt % 2 == 0:
        ans = abs(x%D)
    else:
        ans = abs(D - x%D)
elif x < D:
    cnt = K
    if cnt % 2 == 0:
        ans = abs(x)
    else:
        ans = abs(x-D)

print(ans)
# Judge status: Accepted
A,B = map(int, input().split())
if A >= 13:
	print(B)
elif A >= 6:
    print(B // 2)
else:
	print(0)