peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**6)
N = int(input())
def f(n,s):
    if n == 0:
        print(s)
        return
    for i in [chr(ord("a") + i) for i in range(N-n+1)]:
        mx = 0
        for j in s:
            mx = max(mx,ord(j))
        if s != "" and ord(i) - mx > 1:
            return 
        f(n-1,s+i)
f(N,"")
# Judge status: Accepted
n, k = map(int, input().split())
cnt = 0
MOD = 1000000007
for i in range(k, n+2):
    left = i*(i-1)//2
    right = i*(2*n-i+1)//2
    add = right - left + 1
    cnt = (cnt+add)%MOD
print(cnt)
# Judge status: Accepted
R = int(input())
print(R*2*3.1415)
# Judge status: Wrong Answer
z=(input().split())
a=int(z[0])
b=int(z[1])
c=input()
c=c.replace(c[b-1],c[b-1].lower())
print(c)
# Judge status: Accepted
# -*- coding: utf-8 -*-
 
L = int(input())
 
length = L / 3
 
V = length**3
 
print(V)
# Judge status: Wrong Answer
from collections import deque

s = deque(input().strip())
q = int(input())

reverseFlag = 1

for _ in range(q):
    query = input().strip()
    if query[0] == "1":
        reverseFlag = 1 - reverseFlag
    else:
        lf = reverseFlag + int(query[2])
        if lf % 2 == 0:
            s.append(query[4])
        else:
            s.appendleft(query[4])

if reverseFlag == 1:
    s.reverse()
print("".join(s))
# Judge status: Wrong Answer
A, B, T = map(int, input().split())
if A <= T:
    print(int((T + 0.5) * B) // A)
else:
    print('0')
# Judge status: Accepted
a, b = map(int,input().split())
ave = int((a+b+1)/2)
print(ave)
# Judge status: Accepted
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**9)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a,b,c = na()

if c-a-b > 0 and (4*a*b) < (c-a-b)*(c-a-b):
	print('Yes')
else:
	print('No')
# Judge status: Wrong Answer
s = input()
if len(s) == 1:
	ans = int(s)
else:
	ans = (len(s)-1)*9 + (int(s[0])-1)

print(ans)
# Judge status: Wrong Answer
from collections import Counter

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def pf(N):
    res = []
    x = N
    y = 2
    while y*y <= x:
        while x % y == 0:
            res.append(y)
            x //= y
        y += 1
    if x > 1:
        res.append(x)
    return res

def main():
    a, b = map(int, input().split())
    print(len(Counter(pf(gcd(a,b)))))

if __name__ == "__main__":
    main()
# Judge status: Accepted
n,m=map(int,input().split())
k=set(list(map(int,input().split()))[1:])
for i in range(n-1):
    k.intersection_update(list(map(int,input().split()))[1:])
print(len(k))
# Judge status: Accepted
MOD=1000000007
N,M=map(int,input().split())
a=[]
dp=[0]*100010
for i in range(M):
    tmp=int(input())
    a.append(tmp)
    dp[tmp]=-1
dp[0]=1
for i in range(1,N+1):
    if(dp[i]==-1):
        continue
    if(dp[i-1]!=-1):
        dp[i]=(dp[i]+dp[i-1])%MOD
    if(i>1):
        if(dp[i-2]!=-1):
            dp[i]=(dp[i]+dp[i-2])%MOD
print(dp[N])
# Judge status: Accepted
a,b = map(int,input().split())

socket = 1 
number = 0

if b == 1:
	print(0)
else:
	while True:
		number += 1
		socket = socket - 1 + a
		if socket >= b:
			print (number)
			break
# Judge status: Wrong Answer
N=int(input())
S=input()
ans=0
for i in range(N):
    l,r=set(S[:i+1]),set(S[i:])
    if ans<len(l&r):
        ans=len(l&r)
print(ans)
# Judge status: Wrong Answer
s = input()
ans = 'NO'
pattern = 'keyence'

if pattern in s:
    ans = 'YES'

for i in range(1, len(pattern)):
    x = pattern[:i]
    y = pattern[i:]
    p = 0
    while s.find(x, p) >= 0:
        p = s.find(x, p) + len(x)
        if s.find(y, p) >= 0:
            ans = 'YES'
            break

print(ans)
# Judge status: Wrong Answer
s = input()
Q = int(input())
for i in range(Q):
    q = list(input().split())
    if q[0] == "1":
        s = s[-1] + s[1:-1] + s[0]
    else:
        if q[1] == "1":
            s = q[2] + s 
        else:
            s = s + q[2]
print(s)
# Judge status: Accepted
_, *a = map(int, open(0).read().split())
s = sorted(a)
for i in a:
    print(s[(i < s[-1])-2])
# Judge status: Wrong Answer
N=int(input())
A=[int(x) for x in input().split()]
Q=int(input())
for i in range(Q):
  total=0
  B,C=map(int,input().split())
  if B in A:
    A.remove(B)
    B=C
    A.append(C)
    for j in range(len(A)):
      total+=A[j]
    print(total)
# Judge status: Accepted
def main():
	N = int(input())
	is_able = False

	for i in range(26):
		for j in range(15):
			if 4 * i + 7 * j == N:
				is_able = True
				break

	if is_able:
		print("Yes")
	else:
		print("No")

  
if __name__ == "__main__":
  	main()
# Judge status: Accepted
S = list(input())
T = list(input())

from collections import Counter
cs = Counter(S)
ct = Counter(T)

anss = ['Yes','No']
ans = 0
if len(cs.keys()) != len(ct.keys()): ans = 1
else:
    As = sorted(cs.values())
    At = sorted(ct.values())
    for i in range(len(cs.keys())):
        if As[i] != At[i]:
            ans = 1
            break
print(anss[ans])
# Judge status: Accepted
def main():
    S = int(input())
    x1, y1 = 10**9, 1
    if S < 10**9:
        x1 = 1
        x2 = 0
        y2 = S
    else:
        y2 = 0--S//10**9
        x2 = x1*y2 - S
    print(0, 0, x1, y1, x2, y2)


if __name__ == '__main__':
    main()
# Judge status: Accepted
h,a=map(int,input().split())
print(h//a+1 if h%a else h//a)
# Judge status: Accepted
n, k = map(int, input().split())
p = list(map(int,input().split()))

sum_p =[0]
tmp = 0
for i in p:
    tmp += i
    sum_p.append(tmp)

max_expect = 0
for i in range(k, n+1):
    tmp = sum_p[i] - sum_p[i - k]
    max_expect = max(tmp, max_expect)

ans = (k + max_expect)/2
print(ans)
# Judge status: Wrong Answer
# abc061_b.py

N, M = map(int,input().split())
ab = []
for i in range(M):
    a,b = map(int,input().split())
    ab.append(a)
    ab.append(b)
import collections
ab.sort()
C = collections.Counter(ab)
for i,v in C.items():
    print(v)
# Judge status: Accepted
def main():
    S = input()

    if S[-1] == "s":
        print(S + "es")
    else:
        print(S + "s")


main()
# Judge status: Accepted
import sys

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

ans = [None]*N
for i, order in enumerate(A, 1):
        ans[order-1] = i
print(" ".join(map(str, ans)))
# Judge status: Accepted
A, B, C = map(int, input().split())
ans = 0
if A%2 == 0 or B%2 == 0 or C%2 ==0:
  ans = 0
else:
  ans = min([A*B,B*C,C*A])
print(ans)
# Judge status: Accepted
r = int(input())
pi = 3.141593

print(r * 2 * pi)
# Judge status: Accepted
def modelAnswer(A:int,B:int,C:int,X:int,Y:int) -> int:
   ans = 10**9
   for i in range(10**5+1):
      total = i * 2 * C + max(0,X-i) * A + max(0,Y-i) * B
      ans = min(ans,total)
   return ans

def main():
   A,B,C,X,Y=map(int,input().split())
   print(modelAnswer(A,B,C,X,Y))
if __name__ == '__main__':
   main()
# Judge status: Accepted
import sys
n,x=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in range(n-1):
  if a[i]+a[i+1]>x:
    if a[i]<x:
      ans+=a[i]+a[i+1]-x
      a[i+1]=x-a[i]
    else:
      ans+=a[i]+a[i+1]-x
      a[i+1]=0
print(ans)
# Judge status: Accepted
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

s = ni()

def collatz(x, i):
    if x <= 1:
        return i
    if x % 2 == 0:
        return collatz(x / 2, i + 1)
    else:
        return collatz(3 * x + 1, i + 1)

if s <= 2:
    print(4)
else:
    print(collatz(s, 1) + 1)
# Judge status: Accepted
a, b, c = map(int, input().split())
if c - a - b > 0 and 4 * a * b < (c - a - b)**2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N,M=map(int,input().split())
counter=0
for a in range(N+1):
  for b in range(N+1):
    if 0<=M-(a+b)<=N:
      counter+=1
print(counter)
# Judge status: Accepted
n,a,b = map(int, input().split())
t = (b-a)//2
if (b-a)%2: t += min(a-1,n-b)+1
print(t)
# Judge status: Accepted
S = input()
k = "keyence"
n = len(S)-7

for i in range(len(S)-n+1):
    if S[:i]+S[i+n:] == k:
        print("YES")
        break
else:
    print("NO")
# Judge status: Accepted
H,N=map(int,input().split())

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

sum_damage=0
for i in range(N):
    sum_damage+=A[i]

if sum_damage>=H:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

s=input()
C=collections.Counter(s)
if ((C["N"] or C["S"]) and C["N"]*C["S"] == 0):
  print("No")
elif ((C["W"] or C["E"]) and C["W"]*C["E"] == 0):
  print("No")
else:
  print("Yes")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort()
f=[1]*(10**6+10)
from collections import Counter
c=Counter(a)
ans=0
for ai in a:
  if c[ai]==1 and f[ai]==1:ans+=1
  if f[ai]==1:
    for i in range(ai,10**6+10,ai):
      f[i]=0
print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())

import math
if n == m:
    dog = math.factorial(n)
    mon = math.factorial(m)
    ans = dog * mon * 2
elif n == m + 1 or n == m - 1:
    dog = math.factorial(n)
    mon = math.factorial(m)
    ans = dog * mon
else:
    ans = 0

print(ans // (10 ** 9 + 7))
# Judge status: Wrong Answer
# coding:utf-8
n = int(input())
s = [int(input()) for _ in range(n)]
s.sort()
s = [0] + s
ans = sum(s)


for item in s:
    ans -= item
    if ans % 10 != 0:
        break

print(ans)
# Judge status: Accepted
def resolve():
    N, K = map(int, input().split())
    S = list(input())

    S[K - 1] = S[K - 1].lower()

    print(''.join(S))


resolve()
# Judge status: Accepted
n,a,b = map(int,input().split())

if n%(a+b) < a :
    ans = (n//(a+b))*a + n%(a+b)
    print(ans)
else :
    ans = (n//(a+b))*a + a
    print(ans)
# Judge status: Accepted
X = int(input())

y = 0

for i in range(1, X+1):
    y += i
    if y >= X:
        print(i)
        break
# Judge status: Accepted
D,N = map(int,input().split())
if N == 100:
#need to skip 100 since 100 can be divided by 100 therefore D becomes D+1
    N = 101
print(100**D*N)
# Judge status: Accepted

#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

def main():
    h = ii()
    w = ii()
    n = ii()
    print(ceil(n/max(h,w)))




main()
# Judge status: Accepted
x, y = map(int, input().split())

a = [1, 3, 5, 7, 8 , 10, 12]
b = [4, 6, 9, 11]

if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
elif x == y == 2:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections


x,a,b = map(int,input().split())
if x >= a + b:
    print('delicious')
elif x + a >= b:
    print("safe")
else:
    print('dangerous')
# Judge status: Accepted
n, d = map(int, input().split())

import math
count = 0
for i in range(n):
    x, y = map(int, input().split())
    distance = math.sqrt(x**2+y**2)
    if distance <= d:
        count += 1

print(count)
# Judge status: Wrong Answer
S = input()
up = int(S[0:2])
down = int(S[2:4])

if(up >= 13 and 1 <= down <= 12):
    print("YYMM")
if(1 <= up <= 12 and down >= 13):
    print("MMYY")
if(1 <= up <= 12 and 1 <= down <= 12):
    print("AMBIGUOUS")
if((up >= 13 and down >= 13) or (up == 0 or down == 0)):
    print("NA")
# Judge status: Accepted
s,w=map(int,input().split())
if s<=w:
    print("unsafe")
else:
    print("safe")
# Judge status: Accepted
n = int(input())
tmp = 10
ans = 0

if n % 2 == 0:
    while tmp <= n:
        ans += n//tmp
        tmp *= 5
print(ans)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))

MOD=10**9+7
def gcd(a,b):
    while b: a,b=b,a%b
    return a
def lcm(a,b): return a*b//gcd(a,b)

LCM=A[:]
num=N
while num>1:
    for i in range(1,num,2):
        LCM[i//2]=lcm(LCM[i-1],LCM[i])
    if num&1:
        LCM[num//2]=LCM[num-1]
    num=(num+1)//2

ans=0
l=LCM[0]%MOD
for a in A:
    ans+=l*pow(a,MOD-2,MOD)
    ans%=MOD

print(ans)
# Judge status: Accepted
S = input()
print('x'*len(S))
# Judge status: Accepted
def resolve():
    n = int(input())
    s = list(input() for _ in range(n))
    m = int(input())
    t = list(input() for _ in range(m))

    ans = 0
    temp = 0
    for i in s:
        temp += s.count(i)
        temp -= t.count(i)
        ans = max(ans, temp)
        temp = 0

    print(ans if ans > 0 else 0)

resolve()
# Judge status: Accepted
def main():
    S = input()

    if S[0] == 'A':
        count = 0
        for i in range(2, 2+len(S[2:-1])):
            if S[i] == 'C':
                count += 1
                index = i
        if count == 1:
            S = S[1:index]+S[index+1:]
            if S.islower():
                print('AC')
                return
    print('WA')


if __name__ == '__main__':
    main()
# Judge status: Accepted
X = int(input())

def solve():
    for A in range(-200, 201):
        for B in range(-200, 201):
            if (A**5)-(B**5)==X:
                print(A, B)
                return

solve()
# Judge status: Accepted
n=int(input())
l1,l2=2,1

for i in range(n):
  l1,l2=l2,l1+l2
  
print(l1)
# Judge status: Accepted
def main():
    x = int(input())
    answer = 1
    b = 2
    while b <= x:
        p = 2
        while pow(b, p) <= x:
            answer = max(answer, pow(b, p))
            p += 1
        b += 1
    print(answer)


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

print(int(a*b/2))
# Judge status: Accepted
N,k = map(int,input().split())

a = True
remain = N
dir_list = []

while a:
    if  remain // k > 0:
        dir_list.append(remain)
        remain = remain // k
    else:
        a = False

print(len(dir_list)+1)
# Judge status: Accepted
n, m = map(int, input().strip().split())

if m // 2 < n:
    # S が余っている
    ans = m // 2
else:
    # c が余っている
    ans = n
    # 余った c は 4つずつで Scc にできる
    ans += (m - 2 * n) // 4

print(ans)
# Judge status: Wrong Answer
from math import gcd

n=int(input())
a=list(map(int,input().split()))
if n==2:
  print(max(a))
  exit()
  
a.sort()

pin=a[0]
pin2=a[1]

lst=[]
lst2=[]

for i in a:
  lst.append(gcd(pin,i))
  lst2.append(gcd(pin2,i))
  
lst.sort()
lst2.sort()

print(max(lst[1],lst2[0]))
# Judge status: Wrong Answer
N,K,Q,*A = map(int, open(0).read().split())
ans = [K] * N

for a in A:
    ans[a-1] += 1

for x in ans:
    y = x - Q
    print('Yes' if x > 0 else 'No')
# Judge status: Accepted
x = input().split()
sum = 0

for i in x:
    sum += int(i)

if sum % 9 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
import collections

input = sys.stdin.readline


def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    C = collections.Counter(A)

    ans = 0
    for k in range(10 ** 5 + 1):
        ans = max(ans, sum([C[k], C[k + 1], C[k - 1]]))

    print(ans)


    
    

if __name__ == '__main__':
    main()
# Judge status: Accepted
from itertools import accumulate


n,k = map(int, input().split())
a = list(map(int, input().split()))
def new(a):
    if all([i == n for i in a]):
        print(*a)
        exit()
    res = [0] * (n+1)
    for k,v in enumerate(a):
        res[max(0,k-v)] += 1
        res[min(n,v+k+1)] -= 1
    return list(accumulate(res[:-1]))

for i in range(k):
    a = new(a)
print(*a)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst = [a,b,c,d,e]

lst2 = []

for x in lst:
    amari = x % 10
    if amari == 0:
        pass
    else:
        lst2.append(10 - amari)

if not lst2:
    pass
else:
    lst2.remove(max(lst2))
print(sum(lst)+sum(lst2))
# Judge status: Accepted
walklist=[]
a,b,c,d=map(int,input().split())
x_diff=c-a
y_diff=d-b
walklist.append("U"*y_diff)
walklist.append("R"*x_diff)
walklist.append("D"*y_diff)
walklist.append("L"*(x_diff+1))
walklist.append("U"*(y_diff+1))
walklist.append("R"*(x_diff+1))
walklist.append("D")
walklist.append("R")
walklist.append("D"*(y_diff+1))
walklist.append("L"*(x_diff+1))
walklist.append("U")
print("".join(walklist))
# Judge status: Accepted
n = input()
if n == "RRR":
    print("3")
elif n[:2] == "RR" or n[1:] == "RR":
    print("2")
elif n=="SSS":
    print("0")
else:
    print("1")
# Judge status: Accepted
import math

N=int(input())
#print(list(N))
digits=len(str(N))
cnt=-(-digits//2)
#print(cnt)


ans=0
for i in range(cnt):
    ans+=10**(i*2+1)-10**(i*2)
print(ans if digits%2==0 else ans-(10**(digits)-N)+1)
# Judge status: Wrong Answer
def main():
    a,b,c,d = map(int, input().split())
    if b <= 0 and d <= 0:
        print(a*c)
    elif b >=0 and d <= 0:
        print(a*d)
    elif b <= 0 and d >= 0:
        print(b*c)
    elif b>=0 and d >=0:
        print(b*d)
    
    
if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
w,a,b=map(int,input().split())
if a>b+w:
    print(a-b-w)
elif a+w>b:
    print(a+w-b)
else:
    print(b-a-w)
# Judge status: Accepted
def sep():
    return map(int,input().strip().split(" "))
def lis():
    return list(sep())
import sys
sys.setrecursionlimit(10**6)

n,k=sep()
if n>=k:
    n=(n%k)
print(min(n,abs(k-n)))
# Judge status: Accepted
N = int(input())
h = [int(x) for x in input().split()]

Cost = [0] * N
Cost[1] = abs(h[1] - h[0])

for i in range(2, N):
    Cost[i] = min(Cost[i - 1] + abs(h[i] - h[i - 1]), Cost[i - 2] + abs(h[i] - h[i - 2]))

print(Cost[-1])
# Judge status: Accepted
N=list(input())

N.insert(0,0)
ans=0
for i in range(len(N)-1,-1,-1):
  n=int(N[i])
  if n//10>=1:
    N[i-1]=str(int(N[i-1])+1)
    continue
    
  if n==5:
    if int(N[i-1])>=5:
      N[i-1]=str(int(N[i-1])+1)
    ans+=5
  elif n>=6:
    ans+=10-n
    N[i-1]=str(int(N[i-1])+1)
  else:
    ans+=n
    
print(ans)
# Judge status: Accepted
n = int(input())
als = list(map(int,input().split()))
a1 = 0
a2 = 0
als.sort(reverse=1)
# print(als)
i = 0
while i < n-1:
    # print(i)
    if als[i] == als[i+1] and a1 == 0:
        a1 = als[i]
        i += 2
        continue
    if als[i] == als[i+1] and a1 != 0:
        a2 = als[i]
        break
    i += 1
print(a1*a2)
# Judge status: Wrong Answer
N,M,K = map(int, input().split())

for i in range(N+1):
	for j in range(M+1):
		if i*(N-j)+j*(M-i) == K:
			print('Yes')
			exit()
print('No')
# Judge status: Wrong Answer
n = int(input())
h = list(map(int, input().split()))

step = 0

for i in range(n - 1):
    if h[i] >= h[i + 1]:
        step += 1
    else:
        step = 0

print(step)
# Judge status: Accepted
s=input()
if s[0]==s[1] and s[1]==s[2]:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
x,a,b=map(int,input().split())
if b<=a:print('delicious')
elif b<=a+x:print('safe')
else:print('dangerous')
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())


area = (a+b)*h//2
print(area)
# Judge status: Wrong Answer
n=int(input())
list=input().split()
for f in list:
    f=float(f)
count=1
c=0
for i in range(n-2):
    if list[count]<list[count+1] and list[count]>list[count-1]:
        c=c+1
    elif list[count]>list[count+1] and list[count]<list[count-1]:
        c=c+1
    count=count+1
print(c)
# Judge status: Accepted
#!/usr/bin/env python3
import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    W, H, x, y = MI()
    ans = W * H / 2
    has_other = 1 if W / 2 == x and H / 2 == y else 0

    print(ans, has_other)


main()
# Judge status: Accepted
n, k = map(int, input().split())
x = list(map(int, input().split()))

ans = 10**9

for i in range(n - k + 1):
    if x[i] < 0:
        if x[i + k - 1] < 0:
            ref = -x[i]
        else:
            ref = min(x[i]*-2 + x[i + k - 1], -x[i] + x[i + k - 1]*2)
    else:
        ref = x[i + k - 1]
    ans = min(ans, ref)

print(ans)
# Judge status: Wrong Answer
c = input()
v = ["a", "i", "u", "e", "o"]
if c in v:
    print("vowel")
else:
    print("constant")
# Judge status: Accepted
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())
from operator import sub

def resolve():
    it = map(int, sys.stdin.read().split())
    N = next(it)

    M = 10**9+1
    data = [[M, -M], [M, -M]]
    for x, y in zip(it, it):
        for i, x in enumerate([x+y, x-y]):
            for j, f in enumerate([min, max]):
                data[i][j] = f(data[i][j], x)

    print(max(map(lambda x: abs(sub(*x)), data)))



if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
a,b,k=map(int, input().split())
c=0
for i in range(100):
  if a%(i+1)==0 and b%(i+1)==0:
    c+=1
  if c==k:
    print(i+1)
    exit()
# Judge status: Accepted
a,b=map(lambda x:int(x),input().split())
if a*b<=0:
    print('Zero')
elif a>0 or (b-a+1)%2==0:
    print('Positive')
else:
    print('Negative')
# Judge status: Accepted
N = int(input())
print("ABD" if N>=1000 else "ABC")
# Judge status: Accepted
n,k,*l=map(int,open(0).read().split())
for a,b in sorted(zip(l[::2],l[1::2])):
 k-=b
 if k<1:print(a);exit()
# Judge status: Accepted
n = int(input())
rem = n%10
if rem == 3:
  print("bon")
elif rem == 0 or rem == 1 or rem == 6 or rem == 8:
  print("pon")
else:
  print("hon")
# Judge status: Wrong Answer
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()
print(a if a < b else a-1)
# Judge status: Accepted
X = input().split()
N = int(X[0])
K = int(X[1])

H = input().split()
A = [int(z) for z in H]
B = []
s = []

for z in range(N):
	B.append(0)
	s.append(0)

C = 1
B[0] +=1
s[0] = 0

for i in range(K):
	C = A[C-1] 
	B[C-1] += 1
	if(B[C-1] == 2):
		break
	s[C-1] = i+1

r = i+1 - s[C-1]

if not r == 0:
	#uに余りを入れる
	t = (K - s[C-1])
	u = t % r
	for g in range(u):
		C = A[C-1] 

print(C)
# Judge status: Wrong Answer
k,x = map(int,input().split())
print(i for i in range(int(x-k+1),int(x+k)))
# Judge status: Wrong Answer
n=input()
r=''
count=0
for i in n:
    if i==r:
        count+=1
    r=i
if count>=2:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n=int(input())
l=360/n
print(l)
# Judge status: Accepted
n,*l=map(int,open(0).read().split())
print("YES" if len(set(l))==n else "NO")
# Judge status: Accepted
A, B = map(int, input().split())
print(A*B if 1 <= A <= 9 and 1 <= B <= 9 else "-1")
# Judge status: Wrong Answer
N = int(input())
if 400 <= N and N < 599:
    print(8)
elif 600 <= N and N < 799:
    print(7)
elif 800 <= N and N < 999:
    print(6)
elif 1000 <= N and N < 1199:
    print(5)
elif 1200 <= N and N < 1399:
    print(4)
elif 1400 <= N and N < 1599:
    print(3)
elif 1600 <= N and N < 1799:
    print(2)
elif 1800 <= N and N < 1999:
    print(1)
# Judge status: Accepted
a,b,c = map(int,input().split())
if a%2==0 or b%2==0 or c%2==0:
  print(0)
else:
  print(a*b*c//max(a,b,c))
# Judge status: Accepted
s = input()
N = len(s)

for i in range(N):
    if s[i] == 'A':
        lt = i
        break

for i in range(N)[::-1]:
    if s[i] == 'Z':
        rt = i
        break

print(rt - lt + 1)
# Judge status: Accepted
S = input()
T = input()
if S in T*2:
    print('Yes')
else:
    print('No')