peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
from math import sqrt
from math import floor
n,m = map(int,input().split())
d = m // n
ans = 1
for i in range(1,floor(sqrt(m))+1):
    if m % i == 0:
        if i <= d:
            ans = i
        else:
            break
print(ans)
# Judge status: Accepted
n,a,b = map(int,input().split())
if a%2 == b%2:
    print((b-a)//2)
else:
    print(min(a-1,n-b)+1+(b-a-1)//2)
# Judge status: Wrong Answer
import numpy as np
n,k=map(int,input().split())
H=[int(input()) for i in range(n)]
H.sort()
H=np.array(H)
Hb,Ha=H[-k:],H[:k]
print(min(Hb-Ha))
# Judge status: Wrong Answer
N, K = map(int, input().split())
A = list(map(int, input().split()))
print(-(-N // (K - 1)))
# Judge status: Accepted
x,y = map(int,input().split())
d = y//x
ans = 0
while 0 < d:
  ans += 1
  d //= 2
print(ans)
# Judge status: Accepted
N = int(input())
P = list(map(int, input().split()))
m = N+1
c = 0
for i in range(N):
    if m > P[i]:
        m = P[i]
        c = c + 1
print(c)
# Judge status: Wrong Answer
import math

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

count = 0

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

print(count)
# Judge status: Accepted
N,M=map(int,input().split())
scan=[]
gcan=[]
flag=0
for i in range(M):
    a,b=map(int,input().split())
    if a==1:
        scan.append(b)
    if b==N:
        gcan.append(a)
if set(scan)&set(gcan):
    flag=1
if flag==1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
N, M = map(int, input().split())

if N >= 3 and M >= 3:
    print((M-2)*(N-2))
elif N ==1 and M == 1:
    print(1)
elif N == 1 and M >= 3:
    print(M-2)
elif M ==1 and N >= 3:
    print(N-2)
else:
    print(0)
# Judge status: Accepted
n,a,b=map(int,input().split())

c=10**9+7

nca=1
ncb=1

for i in range(a):
    nca*=(n-i)*pow(i+1,c-2,c)
    nca%=c

for i in range(b):
    ncb*=(n-i)*pow(i+1,c-2,c)
    ncb%=c

ans=pow(2,n,c)-1-(nca+ncb)

ans%=c

print(ans)
# Judge status: Accepted
O = input()
E = input()
ans = []
for i in range(len(E)):
    ans.append(O[i])
    ans.append(E[i])
if len(E)==len(O):
    print("".join(ans))
else:
    ans.append(O[-1])
    print("".join(ans))
# Judge status: Wrong Answer
n = int(input())
s = input()

# full search
cnt = s.count('E')

ans = cnt
for i in range(n-1):
    if s[i] == 'E':
        cnt -= 1
        if ans > cnt:
            ans = cnt
    
    else:
        cnt += 1

print(ans)
# Judge status: Wrong Answer
K,S=map(int,input().split())
count=0
for X in range(K+1):
    for Y in range(X,K+1):
        for Z in range(Y,K+1):
            com=X+Y+Z
            if(com==S):
                count+=1
            else:
                pass
print(count)
# Judge status: Accepted
n,k=map(int,input().split())
L=list(map(int,input().split()))
L.sort()
ans=0
for i in range(k):
  ans+=L[i]

print(ans)
# Judge status: Accepted
s = input()
t = input()
l = len(s)
if s == t[:l]:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
ans = []
cnt = 0

for s in input():

    if not s in "ACGT":
        ans.append(cnt)
        continue
    
    cnt += 1

ans.append(cnt)

print(max(ans) )
# Judge status: Accepted
import sys
readline = sys.stdin.readline

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

l=1
r=n
used = set()
while len(used) < m * 2:
  diff = r - l
  rdiff = n - diff
  if diff == rdiff:
    r -= 1
    continue
  if diff in used:
    r -= 1
    continue
  print(l,r)
  used.add(diff)
  used.add(rdiff)
  l += 1
  r -= 1
# Judge status: Wrong Answer
K,X =map(int,input().split())
l = []
for i in range(X-K+1,X+K):
  l.append(str(i))
##print(l)
print("".join(l))
# Judge status: Accepted
n = int(input())

l = list()
c = 0

for i in range(n):
    x = input()
    l.append(x)

l = set(l)
print(len(l))
# Judge status: Accepted
from itertools import product
s = list(input())
n = len(s)-1

for x in list(product(["+", "-"], repeat=n)):
    x = list(x)
    x.append("")
    
    strs = [i+j for i, j in zip(s, x)]
    if eval("".join(strs)) == 7:
        print("".join(strs) + "=7")
        break
# Judge status: Accepted
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)

ans = 0
i = 0
for j in range(n - 1):
    ans += a[i]
    if j % 2 == 0:
        i += 1
print(ans)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import sys

def main():
  alist = [
    "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
    "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
    "u", "v", "w", "x", "y", "z",
  ]

  for s in sys.stdin:
    i = 0
    for a in alist:
      if s == a:
        print(alist[i+1], end="")
      i += 1

if __name__ == '__main__':
  main()
# Judge status: Accepted
import math

N = int(input())
#sqrtN = math.floor(math.sqrt(N))
#count = 1
#for i in range(sqrtN):
#   count += 2 *((N-1) // (i+2))
count = 0
for i in range(N):
  count += (N-1) // (i+1)
  
print(count)
# Judge status: Accepted
import itertools
import numpy as np

n, m, x = map(int, input().split())
c = []
a = []
for i in range(n):
    cu, *au = list(map(int, input().split()))
    c.append(cu)
    a.append(au)
c = np.array(c)
a = np.array(a)
    
pmin = 10000000
for e in itertools.product([0, 1], repeat=n):
    e = np.array(e)
    results = np.dot(e, a)
    if results.min()>=x:
        p = np.dot(e, c)
        if p < pmin:
            pmin = p

pmin = -1 if pmin==10000000 else pmin
print(pmin)
# Judge status: Wrong Answer
num=[int(i) for i in input().split()]

num.sort()

print(num[1]+num[2])
# Judge status: Accepted
#!/usr/bin/env python
# coding: utf-8

# In[8]:


A, B = map(int, input().split())
S = input()


# In[11]:


flag = True
for x in S[:A]:
    if x == "-":
        flag = False
        break
if flag:
    for x in S[A+1:]:
        if x == "-":
            flag = False
            break
if flag:
    if S[A] != "-":
        flag = False
if flag:
    print("Yes")
else:
    print("No")


# In[ ]:
# Judge status: Accepted
n = int(input())
s = input()
m = 0
for i in range(1, n-1):
  if m < len(list(set(s[:i]) & set(s[i:]))):
    m = len(list(set(s[:i]) & set(s[i:])))
print(m)
# Judge status: Accepted
W,H,x,y = map(int,input().split())
print(H*W/2, int(W/2 == x and H/2 == y))
# Judge status: Accepted
nums = input()
n = 4


def calc(i, f, sum):
    if i == n-1:
        if sum == 7:
            print(f+'=7')
            exit()

    else:
        calc(i+1, f + '-' + nums[i+1], sum - int(nums[i+1]))
        calc(i+1, f + '+' + nums[i+1], sum + int(nums[i+1]))


calc(0, nums[0], int(nums[0]))
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a<=b:
  for i in range(b):
    print(a,end="")
else:
  for i in range(a):
    print(b,end="")
# Judge status: Wrong Answer
n, k , s = map(int, input().split())
ans = []
for i in range(k):
  ans.append(str(s))
for i in range(n-k):
  ans.append(str(s+1))
print(" ".join(ans))
# Judge status: Accepted
#ABC042A
x = list(input().split())
print("YES" if x.count("5")==2 and x.count("7")==1 else "NO")
# Judge status: Wrong Answer
A,B,C = [int(x) for x in input().split()]

if A != B and B != C and C!= A:
	print("No")
else:
	print('Yes')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

cnta, cntb = 0, 0
for i in range(N):
  a, b = A[i], B[i]
  if a > b :
    cntb += a-b
    continue
  if (b-a)%2 > 0:
    cntb += 1
    b += 1
    
  cnta += (b-a) // 2
  
#print(cnta, cntb)
print('Yes' if cnta >= cntb else 'No')
# Judge status: Accepted
K,X = map(int, input().split())
ans = list()
i = -(K-1)
while i<K:
    ans.append(X+i)
    i+=1
print(*ans)
# Judge status: Accepted
a,b,x=list(map(int,input().split()))
import math
x=x/a
if a*b/2<x:
   print(math.degrees(math.atan(2*(a*b-x)/a**2)))
else:
   print(math.degrees(math.atan(b**2/(2*x))))
# Judge status: Accepted
A,B,H,M = map(int, input().split())
import math
Hrad = H*math.pi*2/12 + M*math.pi*2/(60*12)
Mrad = M*math.pi*2/60
theta = abs(Hrad - Mrad)
print(math.sqrt(A**2 + B**2 -2*A*B*math.cos(theta)))
# Judge status: Wrong Answer
from fractions import gcd
N, X = map(int, input().split())
x = list(map(int, input().split()))
if (N == 1):
   print(x[0])
   exit(0)
ans = abs(X - x[0])
for i in range(1, len(x)):
    ans = gcd(abs(x[i] - x[i - 1]), ans)
print(ans)
# Judge status: Accepted
import fractions
from functools import reduce
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
n,x=map(int,input().split())
print(gcd_list([abs(int(i)-x) for i in input().split()]))
# Judge status: Accepted
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
tmp = float('inf')
ans = 0
for i in range(n):
    if tmp > abs(a - (t-h[i]*0.006)):
        tmp = abs(a- (t-h[i]*0.006))
        ans = i

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

div_1,div_2,div_4=0,0,0
for a in A:
    if a%4==0:
        div_4+=1
    elif a%2==0:
        div_2+=1
    elif a%2!=0:
        div_1+=1
if div_2==0 and div_1<=div_4+1:
    print('Yes')
elif div_2>0 and div_1<=div_4:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
mod = N%10
if mod == 3:
    print("bon")
elif mod in {0, 1, 6, 8}:
    print("pon")
else:
    print("hon")
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))
avg=0
for j in range(N):
    avg+=a[j]
avg=avg/N
t=int(avg)
if abs(t-avg)>abs(t+1-avg):
    t=t+1
cost=0
for j in range(N):
    cost+=(a[j]-t)**2
print(cost)
# Judge status: Accepted
m,*p=[],
for i in [*open(0)][1:]:x,y=map(int,i.split());m+=x-y,;p+=x+y,
a=max;print(a(a(m)-min(m),a(p)-min(p)))
# Judge status: Accepted
n, m = [int(i) for i in input().split()]

a = [1 for i in range(n+1)]
for i in range(m):
    a[int(input())] = 0

dp = [0 for i in range(n + 1)]
dp[0] = 1
if a[1]:
    dp[1] = 1

for i in range(2, n + 1):
    dp[i] = a[i] * (dp[i-2] * a[i-2] + dp[i-1] * a[i-1])

print(dp[-1] % 1000000007)
# Judge status: Accepted
ans=1
md=10**9+7
for i in range(1,int(input())+1):
  ans=(ans*i)%md
print(ans)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
s=sum(A)
import collections
a= collections.Counter(A)
for i in range(Q):
    B,C=map(int,input().split())
    n=a[B]
    s+=(C-B)*n
    print(s)
    a[B]=0
    a[C]=a[C]+n
# Judge status: Accepted
N, M = map(int,input().split())
AB = []
for _ in range(M):
    a,b = map(int,input().split())
    if  a == 1 or b== N:
        AB.append((a,b))
set1 = set()
set2 = set()
for ab in AB:
    if ab[0] == 1:
        set1.add(ab[1])
    if ab[1] == N:
        set2.add(ab[0])
if set1 & set2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
a, b, c = list(map(int, input().split(" ")))
k = int(input())

for i in range(k):
    if b <= a:
        b *= 2
    else:
        c *= 2

if b > a and c > b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = input()
K = int(input())
s = list(s)

# print(diff)

for i in range(len(s)):
    if s[i] != 'a':
        dist = ord('z') - ord(s[i]) + 1
        if dist <= K:
            K -= dist
            s[i] = 'a'
# print(s)
temp = K % 26
s[-1] = chr(ord(s[-1]) + temp)
# print(s)

print(''.join(s))
# Judge status: Wrong Answer
h = int(input())
w = int(input())

k = int(input())

a = (k // (max(h, w) - 1))
print(a + 1)
# Judge status: Accepted
n=int(input())
a=[]
for i in range(n):
  b,c=map(str,input().split())
  d=[str(i+1),b,int(c)*(-1)]
  a.append(d)
  
a.sort(key=lambda x:x[1])
r={}
ans=[]
q=[]

for f in a:
  e=f[1]
  t=[f[0],f[2]]
  if e not in r:
    q.sort(key=lambda x:x[1])
    ans.append(q)
    q=[]
    q.append(t)
    r[e]=0
    
  else:
    q.append(t)


q.sort(key=lambda x:x[1])
ans.append(q)

for y in ans:
  for w in y:
    print(w[0])
# Judge status: Accepted
from bisect import bisect_right, bisect_left
def main():
    n = int(input())
    A = sorted(list(map(int, input().split())))
    B = list(map(int, input().split()))
    C = sorted(list(map(int, input().split())))
    ans = 0
    for b in B:
        ans += bisect_left(A, b) * (n - bisect_right(C, b))
    print(ans)


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

while a < X:
  i += 1
  a += i
  
print(i)
# Judge status: Accepted
s = input()

if s[len(s)-1] == "s":
  print(s+"es")
else:
  print(s+"s")
# Judge status: Accepted
a,b = map(int,input().split())

if a > 0 and b > 0:
    print("Positive")
elif a == 0 or b == 0:
    print("Zero")
elif a < 0 and b > 0:
    print("Zero")
elif a < 0 and b < 0:
    tmp = abs(a-b)
    if tmp % 2 == 0:
        print("Negative")
    else:
        print("Positive")
# Judge status: Accepted
X = int(input())
r = 0 if (X % 11) % 6 == 0 else 1
print((X // 11) * 2 + (X % 11) // 6 + r)
# Judge status: Accepted
chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
n = int(input())
seq = [97 for i in range(n)]
i = n - 1
print('a' * n)
while i > 0:
    if seq[i] <= max(seq[:i]):
        seq[i] += 1
        i = n - 1
        print(''.join(map(chr, seq)))
    else:
        seq[i] = 97
        i -= 1
# Judge status: Accepted
A, s, C = input().split()
print('A{}C'.format(s[0]))
# Judge status: Accepted
def solve(n, x, y):
    res_list = [0] * n
    for i in range(n - 1):
        for j in range(i + 1, n):
            d = min(j - i, abs(i - x+1) + abs(j - y+1) + 1)
            res_list[d] += 1
    return res_list[1:]


n, x, y = map(int, input().split())
res_list = solve(n, x, y)
for res in res_list:
    print(res)
# Judge status: Wrong Answer
a = int(input())
b = int(input())

A = [1, 2, 3]
A.pop(a-1)
A.pop(b-2)
print(A[0])
# Judge status: Accepted
def main(h: int, w: int, n: int):
    m = max(h, w)

    if n % m == 0:
        print(n // m)
    else:
        print((n // m) + 1)


if __name__ == "__main__":
    h = int(input())
    w = int(input())
    n = int(input())

    main(h, w, n)
# Judge status: Wrong Answer
n,m = map(int,input().split())
pre = [[] for _ in range(n)]
num=[]
for i in range(m):
    p,y = map(int,input().split())
    pre[p-1].append([i,y])
for i in range(n):
    pre[i].sort(key=lambda x:x[1])
    for j in range(len(pre[i])):
        num.append([pre[i][j][0],('0'*5+str(i+1))[:6]+('0'*5+str(j+1))[:6]])
num.sort(key=lambda x:x[0])
for k in num:
    print(k[1])
# Judge status: Wrong Answer
S = input()
print("2018"+S[5:])
# Judge status: Accepted
s = input()

if s[0] != s[1]:
    print("Yes")
elif s[1] != s[2]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
cumsum = [0]
for a in A:
  cumsum.append(cumsum[-1]^a)

res = []
for i in range(N):
  res.append(cumsum[-1]^A[i])

print(" ".join(map(str, res)))
# Judge status: Accepted
a,b,c=map(int,input().split())
if c>=a and c<=b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import collections

N=int(input())
D=list(map(int,input().split()))
mod=998244353
data=collections.Counter(D)

if D[0]==0 and data[0]==1:
    count=1
    for i in range(1,len(data)):
        count*=data[i-1]**data[i]
        count%=mod
    print(count)
else:
    print(0)
# Judge status: Wrong Answer
import math
x, y = [int(x) for x in input("").split()]
a = math.log(x,y)
b=x%y
c=x/y
if(c==0):
    print ("1")
elif(b==0):
    print (math.ceil(a)+1) 
else:
    print (math.ceil(a))
# Judge status: Wrong Answer
a=int(input())
if a >= 1000:
  print("ABD",a%1000+1)
else:
  print("ABC",a)
# Judge status: Accepted
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
a = []
s = S[0]
for i in range(1,N):
  s += S[i]
  s = ''.join([key*(min(val//2,s.count(key)-S[i].count(key))) for key,val in Counter(s).items() if val > 1])
s = sorted(s)
print(''.join(s))
# Judge status: Wrong Answer
s = str(input())
num = [0 for _ in range(len(s)+1)]
for i in range(len(s)):
  if (s[i] == "<"):
    num[i+1] = num[i]+1
for i in range(len(s),1,-1):
  if (s[i-1] == ">"):
    num[i-1] == max(num[i-1],num[i]+1)
print(sum(num))
# Judge status: Accepted
import numpy
a,b = map(int,input().split())

if numpy.sign(a*b)==-1:
  print('Zero')
elif (numpy.sign(a)==1) or (numpy.sign(b)==1):
  print('Positive')
elif (a-b)%2==0:
  print('Negative')
else:
  print('Positive')
# Judge status: Accepted
n ,k ,s = map(int, input().split())

a = [s] * n

for i in range(k,len(a)):
    if s != 1:
        a[i] -= 1
    else:
        a[i] += 1

print(" ".join(map(str, a)))
# Judge status: Wrong Answer
#!/usr/bin/env python3

def main():
    n = int(input())
    cnt = 0
    while n % 2 == 0:
        n /= 2
        cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
let = [0]*26
S = input()
for a in range(len(S)):
  let[ord(S[a])-ord("a")] += 1
    
for i in range(N-1):
  S = input()
  let_S = [0]*26
  for j in range(len(S)):
    let_S[ord(S[j])-ord("a")] += 1
  for k in range(26):
    if let[k] > let_S[k]:
      let[k] = let_S[k]

ans = ""
for l in range(26):
  ans += chr(ord("a")+l)*let[l]

print(ans)
# Judge status: Accepted
HP,n = map(int,input().split())
s = [tuple(map(int,input().split())) for i in range(n)]

#dp[damage] := モンスターにdamageを与える最小コスト
dp = [float('inf')]*(HP+1) #0~HP
dp[0] = 0
for damage, cost in s:
    for hp in range(HP):
        next_idx = min(hp+damage, HP)
        dp[next_idx] = min(dp[next_idx], dp[hp]+cost)
print(dp[-1])
# Judge status: Accepted

def main():
    
    h,a = map(int, input().split())

    if h <= a:
        print(1)

    elif h%a== 0:
        print(h//a)
    else:
        print(h//a+1)


if __name__ == '__main__':
    main()
# Judge status: Accepted
from collections import Counter

n = int(input())
s = [list(input()) for _ in range(n)]
for i in range(n):
    s[i].sort()
    s[i] = ''.join(s[i])
counter = Counter(s)
ans = 0
for val in counter.values():
    ans += val * (val - 1) // 2
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)

ans = 0
for i in range(n-1):
  num = i // 2
  num += 1
  if i == 0:
    ans += a[i]
  else:
    ans += a[i-num+1]
print(ans)
# Judge status: Wrong Answer
n,x=map(int,input().split())
l=list(map(int,input().split()))
k=0
cnt=0
for i in range(n):
    k += l[i]
    cnt += 1
    if k>x:
        print(cnt+1)
        exit()
    else:
        continue
print(cnt+1)
# Judge status: Wrong Answer
n, k = map(int, input().split())

for _ in range(n):
    a, b = map(int, input().split())
    k -= b
    if k <= 0:
        ans = a
        break
print(ans)
# Judge status: Wrong Answer
a=list(map(int,input().split()))
if (a[0]+a[1])%2==0:
  	print((a[0]+a[1])/2)
else:
  	print("IMPOSSIBLE")
# Judge status: Wrong Answer
S=input()
t=[a for a in S]
number=0
for a in range(2):
    if 'a' in t:
        number+=1
    elif 'b' in t:
        number+=1
    elif 'c' in t:
        number+=1
if number==3:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def main():
    N = input()
    if N[0] == N[1] == N[2] or N[1] == N[2] == N[3]:
        print("Yes")
    else:
        print("No")
main()
# Judge status: Wrong Answer
x,y = map(int,input().split())
if x <= y:
  print(y - x)
else:
  print(abs(-x-y)+ 1)
# Judge status: Accepted
N = int(input())
S = input()

MOD = 10**9 + 7

from collections import Counter

Scnt = Counter(list(S))

ans = 1
for cnt in Scnt.values():
    ans = (ans * (cnt + 1)) % MOD

ans -= 1

print(ans % MOD)
# Judge status: Wrong Answer
N=int(input())
Q=(1+N)*N/2-N
print(int(Q))
# Judge status: Accepted
S,T = map(str,input().split())
X,Y = map(int,input().split())
Z = input()
if S==Z:
  print(X-1,Y)
elif T==Z:
    print(X,Y-1)
else:
    print(X,Y)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from collections import Counter

for check in list(Counter(read().rstrip().decode()).values()):
    if check % 2 == 1:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
S = input()

now = "aa"
tmp = ""
ans = 0

for s in S:
	tmp += s
	if tmp != now:
		ans += 1
		now = tmp
		tmp = ""	

print(ans)
# Judge status: Wrong Answer
n = int(input())
blue = [input() for i in range(n)]
m = int(input())
red = [input() for i in range(m)]
a = set(blue)
ans = []
for i in a:
  b = 0
  for j in range(n):
    if blue[j] == i:
      b += 1
  for j in range(m):
    if red[j] == i:
      b -= 1
  ans.append(b)
print(max(ans))
# Judge status: Accepted
a,b = map(int, input().split())
s = input()

ok = True
ok = ok and  s[0:a].isdecimal()
ok = ok and s[a] == '-'
ok = ok and s[a+1:].isdecimal()

if ok:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N = int(readline())
  for i in range(50000):
    a = int(i*1.08)
    if a == N:
      print(i)
      break
    else:
      continue
  else:
    print(':(')
  
  
  
if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
n=int(input())
dict={}
count=0
for i in range(0,n):
  temp=str(input())
  temp=sorted(list(temp))
  temp="".join(temp)
  if temp in dict:
    dict[temp]=dict[temp]+1
    count=count+dict[temp]
  else:
    dict[temp]=1
print(count)
# Judge status: Accepted
a=list(map(int,input().split('/')))
#print(a)
if a[0]==2019:
    if a[1]==4:
        if 30>=a[2]:
            print("Heisei")
        else:
            print("TBD")
    elif 5>a[1]:
        print("Heisei")
    else:
        print("TBD")
elif 2019>=a[0]:
    print("Heisei")
else:
        print("TBD")
# Judge status: Accepted
import bisect
n = int(input())
A = [int(input()) for i in range(n)]
A_sd = sorted(A)
for a in A:
  if bisect.bisect_left(A_sd, a) == n - 1:
    print(A_sd[-2])
  else:
    print(A_sd[-1])
# Judge status: Wrong Answer
from collections import deque
S = deque([s for s in input()])
Q = int(input())
for i in range(Q):
    query = input().split()
    t = int(query[0])
    if t == 1:
        S[0], S[-1] = S[-1], S[0]
    else:
        f = int(query[1])
        c = query[2]
        if f == 1:
            S.appendleft(c)
        else:
            S.append(c)
print(''.join(S))
# Judge status: Wrong Answer
A,B=map(int,input().split())

if A and B <=9:
	print(A*B)
else:
	print("-1")
# Judge status: Accepted
A,B=map(int,input().split())
import fractions 
import collections
GCD=fractions.gcd(A,B)
a=[]

while GCD % 2 ==0:
  a.append(2)
  GCD //= 2
f = 3
while f * f <= GCD:
  if GCD % f == 0:
    a.append(f)
    GCD //= f
  else:
    f += 2
if GCD != 1:
  a.append(GCD)
#print(a)
c = collections.Counter(a)
#print(c)
#print(sum(c.values())+1)
print(len(c)+1)
# Judge status: Accepted
S = input()
i=0
ans = 1000
while i < len(S)-2:
  tmp = abs(753-int(S[i:i+3]))
  ans = min([ans, tmp])
  i+=1
print(ans)
# Judge status: Accepted
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()



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

if X<0:
    X*=-1


k=X//D
if k>=K:
    print(X-K*D)
else:
    K-=k
    if K%2:
        print(-(X-(k+1)*D))
    else:
        print(X-k*D)
# Judge status: Accepted
N = int(input())
p = list(map(int, input().split()))

p2 = sorted(p)

cnt = 0
for i in range(N):
    if p[i] != p2[i]:
        cnt += 1
    if cnt == 3:
        break

if cnt == 3:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))

def twosekisum(A):
    return (sum(A)**2-sum([i**2 for i in A]))//2
print(twosekisum(A)%(10**9+7))
# Judge status: Accepted
n = int(input())
for i in range(100//4):
    for j in range(100//7):
        if n == i * 4 + j * 7:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
import math
import bisect

X = int(input())

N = 100100
primes = [i for i in range(X + 100)]
primes[1] = 0

for prime in primes:
    if prime > math.sqrt(N):
        break
    if prime == 0:
        continue
    for non_prime in range(2 * prime, X + 100, prime):
        primes[non_prime] = 0
    
lpm = [prime for prime in primes if prime != 0]
i = bisect.bisect_left(lpm, X)
print(lpm[i])