peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N=int(input())

D=dict()
for i in range(N): 
    S=input()

    if S not in D:
        D[S]=1
    else:
        D[S]+=1

M=D[max(D)]
ans=[]
for s in D:
    if D[s]==M:
        ans.append(s)

ans.sort()
A=''
for s in ans:
    A+='{}\n'.format(s)

print(A)
# Judge status: Accepted

a,b=map(str,input().split())
for i in range(1,int(a+b)):

            if int(a+b)==i**2:
                        #print(int(a+b),i)
                        print('Yes')
                        exit()

#print(int(a+b),i)
print('No')
# Judge status: Accepted
a, b, c, d = map(int, input().split())
if abs(c-a) <= d or (abs(b-a) <= d and abs(c-b) <= d):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N, M = map(int, input().split())
PS = [[0, 0] for i in range(N)] 
for i in range(M):
  p, s = input().split()
  if s == "AC":
    PS[int(p) - 1][0] = 1
  elif s == "WA" and PS[int(p) - 1][0] == 0:
    PS[int(p) - 1][1] += 1
ac = 0
wa = 0
for ps in PS:
  if ps[0] == 1:
    ac += 1
    wa += ps[1]
print(ac, wa)
# Judge status: Accepted
a,b = map(int,input().split())
if a <= 0 and b >= 0:
    print("Zero")
elif a > 0:
    print("Positive")
else:
    if (b-a)%2 == 0:
        print("Negative")
    else:
        print("Positive")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
b = list(set(a))
import collections
c = collections.Counter(a)
g = []
for i in range(len(b)):
    if c[b[i]] >= 2:
        g.append(b[i])
if len(g) <= 1:
    g = []
    for i in range(len(b)):
        if c[b[i]] >= 4:
            g.append(b[i])
    if len(g) == 0:
        print(0)
    else:
        g = sorted(g,reverse = True)
        print(g[0]**2)
else:
    g = sorted(g,reverse = True)
    print(g[0]*g[1])
# Judge status: Accepted
i=int(input())
print(0.5 if i%2==0 else 1.0 if i==1 else (i//2+1)/i)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys
from math import gcd
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
A=list(map(int,input().split()))
ans=A[0]
for x in A[1:]:
    ans=gcd(ans,x)
print(ans)
# Judge status: Accepted
# sys.stdin.readline()
import sys
input = sys.stdin.readline
import collections

N = int(input())
A = list(map(int,input().split()))
c = collections.Counter(A)
cnt=[]
for k in c:
    cnt.append(c[k]*(c[k]-1)//2)

s=sum(cnt)
for i in range(N):
    print(s-c[A[i]]+1)
# Judge status: Accepted
X = int(input())

print((X//500)*1000+(X%500)//5*5)
# Judge status: Wrong Answer
from sys import stdin

def main():

    input = stdin.readline

    A,V = map(int,input().split())
    B,W = map(int,input().split())
    T = int(input())


    if(V <=  W):
        print("NO")
    else:
        X = abs(V - W)

        if (abs(A - B) // X <= T) & (abs(A - B) % X == 0):
            print("YES")
        else:
            print("NO")

if __name__ == "__main__":
    main()
# Judge status: Accepted
def II(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
N=II()
A=LI()
ans=1000
for i in range(N-1):
  if A[i]<A[i+1]:
    ans+=(ans//A[i])*(A[i+1]-A[i])
print(ans)
# Judge status: Accepted
a, b, k = map(int,input().split())

ans = set([])
if b > a+k:
    for i in range(a,a+k):
        ans.add(i)
    for i in range(b-k+1,b+1):
        ans.add(i)
else:
    for i in range(a,b+1):
        ans.add(i)
ans = sorted(ans)
for i in ans:
    print(i)
# Judge status: Wrong Answer
data1 = input()
data2 = input()

count = len(data1) - 1
sw = 0
i = 0
j = len(data2)-1
while i <= count:
    if data1[i] == data2[j]:
        sw += 1
    i += 1
    j -= 1
if sw == len(data1):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

x = [0]*(n+1)
for i in range(1, n+1):
    x[a[i-1]] += 1
print(x)
sumx = 0
for i in range(1, n+1):
    sumx += x[i] * (x[i]-1) // 2

for i in range(1, n+1):
    print(sumx - x[a[i-1]] * (x[a[i-1]]-1) // 2 + (x[a[i-1]]-1) * (x[a[i-1]]-2) // 2)
# Judge status: Wrong Answer
K = int(input())
A,B = map(int,input().split())

if B - A + 1 >= K:
    print("OK")
elif K >= A:
    print("OK")
else:
    print("NG")
# Judge status: Accepted
l,r,d=map(int, input().split())

cnt = 0
tmp = 0

while tmp <= r:
    tmp = tmp + d
    if tmp >= l and tmp <= r:
        cnt+=1

print(cnt)
# Judge status: Accepted
k, x = map(int, input().split())
a = []
for i in range(x-k+1,x+k):
	a.append(str(i))
print (" ".join(a))
# Judge status: Wrong Answer
# 169A

# 1.入力をちゃんと受け取る。図解をする
# ex: [2 5] a=2 b=5 

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

print(a)
print(b)
# 2.計算
answer=a*b

# ３出力
print(answer)
# Judge status: Accepted
a = list(map(int, input().split()))
ans = 'bust' if sum(a) >= 22 else 'win'
print(ans)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if abs(a - c) <= d:
    ans = 'Yes'
elif abs(a - b) <= d and abs(b - c) <= d:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
K = int(input())

for i in range(K):
    if B <= A:
        print('a')
        B *= 2
        
    elif C <= B:
        print('b')
        C *= 2
        
    else:
        print('C')
        C *= 2
        
if A < B and B < C:
    print('Yes')
    
else:
    print('No')
# Judge status: Wrong Answer
#!/usr/bin/env python3
# atcoder 
# Türkçe konuşyorum
# Türkler var mı
# memnün oldum

K = int(input())
S = input()

if(len(S) <= K):
    print(S)
else:
    print(S[K:] + '.' * 3)
# Judge status: Accepted
S = input()
N = int(S)
ans = sum(map(int,S))

for i in range(1,len(S)):
    n = str(int(S[:i]) - 1)
    t = sum(map(int,n)) + 9*(len(S)-i)
    ans = max(ans,t)
print(ans)
# Judge status: Accepted
# すぬけくんはレストランに通うのが好きです。
# すぬけくん行きつけのレストランは何を食べても1食 800円で、15食食べる毎にその場で 200円もらえます。
# すぬけくんは今までで合計 N食食べました。 今までに払った金額をx円、レストランからもらった金額を y円として、x−yを求めなさい。

N = int(input())

print(N *800 - (N // 15 *200))
# Judge status: Accepted
S = input()

cost1 = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == '0':
            cost1 += 1
    else:
        if S[i] == '1':
            cost1 += 1

cost2 = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == '1':
            cost2 += 1
    else:
        if S[i] == '0':
            cost2 += 1

print(min(cost1, cost2))
# Judge status: Accepted
N, K = map(int, input().split())

mod = 10**9+7
res = 1
l = K*(K-1)//2
r = l+(N-K+1)*K
for i in range(K, N+1):
    res += r-l+1
    res %= mod
    l += i
    r += N-i
print(res)
# Judge status: Accepted
print('YES' if int(input().replace(' ', '')) % 4 == 0 else 'NO')
# Judge status: Wrong Answer
n,m=map(int,input().split())
ab=[list(map(int, input().split())) for _ in range(m)]

graph = [[] for _ in range(n)]
for v in ab:
    graph[v[0]-1].append(v[1]-1)
    graph[v[1]-1].append(v[0]-1)
# print(graph)

from collections import deque

queue = deque([0])
d = [100] * n
d[0] = 0
while queue:
    v = queue.popleft()
    for i in graph[v]:
        if d[i]==10**6:
            d[i] = d[v] + 1
            queue.append(i)
# print(d)

print('POSSIBLE' if d[n-1]<=2 else 'IMPOSSIBLE')
# Judge status: Accepted
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

li = [ri() for _ in range(5)]
lis = [math.ceil(i/10)*10 for i in li]
ans = inf
for i in range(5):
  ans = min(sum(lis[:i])+li[i]+sum(lis[i+1:]), ans)
print(ans)
# Judge status: Wrong Answer
s = list(input())
n = len(s)
s.append('<')
mini = 0
maxi = 0
p = 0

for i in range(n):
    if s[i] == '<':
        mini += 1
    else:
        maxi += 1
        if s[i+1] == '<':
            p += (1 + max(mini,maxi)) * max(mini,maxi) // 2
            p += (min(mini,maxi) - 1) * (min(mini,maxi) - 1) // 2
            mini = 0
            maxi = 0

if mini != 0:
    print(p + ((1+mini) * (mini) // 2))
else:
    print(p)
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split()))

A = [10**5]*N
for i in range(N-1):
    A[i] = min(A[i], B[i])
    A[i+1] = min(A[i+1], B[i])

print(sum(A))
# Judge status: Accepted
n,m,*a=map(int,open(0).read().split())
b=min(a[1::2])-max(a[::2])+1
print(b if b>0 else 0)
# Judge status: Accepted
A = list(map(int, input().split()))
K = int(input())
A.sort()
print(A[0]+A[1]+A[-1]*pow(2,K))
# Judge status: Wrong Answer
a, b = map(int, input().split())
print(10*a+b-11+1)
# Judge status: Accepted
N, K, Q, *A = map(int, open(0).read().split())
ans = [K - Q] * N
for a in A:
    ans[a - 1] += 1
print('\n'.join('Yes' if v > 0 else 'No' for v in ans))
# Judge status: Accepted
n = int(input())

s = 0
for i in range(1,10**5):
  s += i
  if s >= n:
    t = i
    break

if s == n:
  for i in range(1,t+1):
    print (i)
else:
  for i in range(1,t+1):
    if i == s-n:
      continue
    print (i)
exit()
# Judge status: Wrong Answer
N,M = map(int,input().split())
AB = []
for _ in range(N):
    AB.append([int(i) for i in input().split()])
AB_sort = sorted(AB,key=lambda x : x[0])
money = 0
for ab in AB_sort:
    if M >= ab[0]:
        money += ab[0] * ab[1]
        M -= ab[1]
    else:
        money += M * ab[0]
        break
print(money)
# Judge status: Accepted
n, k = map(int, input().split())
ans = 0
count = 0

if k == 1:
  print(1)
else:
  for i in range(1, n+1):
    while i < k:
      i *= 2
      count += 1
    ans = ans + 0.5**count/n
    count = 0
  
  print(ans)
# Judge status: Accepted
x = int(input())
cnt = 0

a = int(x/11)
cnt = a*2
x -= 11*a
if x == 0:
    cnt += 0
elif x < 7:
    cnt += 1
else:
    cnt += 2
print(cnt)
# Judge status: Wrong Answer
a, b = input().split()
c = int(a + b)

for i in range(1,101):
  if i * i == c:
    print("Yes")
    break
else:
  print("No")
# Judge status: Accepted
# must have sum even. This only happens for x,y both even or both odd.
# N even, so N*(N-1)/2 pairs of them (not counting order). Same for M.
N, M = map(int, input().split())
num_N = N*(N-1)//2
num_M = M*(M-1)//2
print(num_N+num_M)
# Judge status: Accepted
import math
A, B = list(map(int, input().split()))

amax = math.ceil((A + 1) / 8 * 100) - 1
amin = math.ceil(A / 8 * 100)
bmax = math.ceil((B + 1) * 10) - 1
bmin = math.ceil(B * 10)

if amin > bmax or bmin > amax:
    print(-1)
else:
    print(int(max(amin, bmin)))
# Judge status: Wrong Answer
N = int(input())

a = [0]* N

x = [i for i in range(1,43)]
y = [i for i in range(1,43)]
z = [i for i in range(1,43)]
ans = []
for i in x:
    for j in y:
        for k in z:
            t = (i**2+j**2+k**2+i*j+j*k+k*i)
            if t <= N:
                a[t-1] += 1
            
for i in range(N):
    print(a[i])
# Judge status: Wrong Answer
def solve():
    N = input()
    if len(N) == 1:
        print(int(N))
    elif all(i == '9' for i in N):
        print(9 * len(N))
    else:
        print((int(N[0]) - 1) + 9 * (len(N) - 1))

if __name__ == "__main__":
    solve()
# Judge status: Wrong Answer
aaa = [int(input()) for i in range(6)]
 
ans = ":("
 
a = aaa[0]
for i in range(1,5):
    if aaa[5] <= abs(a - aaa[i]):
        ans = "Yay"
        break
    a = aaa[i]
print(ans)
# Judge status: Wrong Answer
n = int(input())
ANS =[0 for _ in range(n)]
for x in range(1, int((n/2)**0.5) + 1):
    for y in range(1, int((n/2)**0.5) + 1):
        for z in range(1, int((n/2)**0.5) + 1):
            if x**2 + y**2 + z**2 + x*y + y*z + z*x > n:
                continue
            ANS[(x**2 + y**2 + z**2 + x*y + y*z + z*x) - 1] += 1
for i in ANS:
    print(i)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

NA = set(A)
d = {x:0 for x in NA}

for i in range(N):
    d[A[i]] += 1

counter = 0
for p in d:
    if p > d[p]:
        counter += d[p]
    else:
        counter += d[p]-p

print(counter)
# Judge status: Wrong Answer
n = int(input())
ans = 0
total = 0
for i in range(n//2 + 1):
    for j in range(1, 2*i + 2):
        if (2*i + 1) % j == 0:
            ans += 1
    if ans == 8:
        total += 1
    ans = 0
print(total)
# Judge status: Wrong Answer
N = int(input())
lst_a = sorted([int(x) for x in input().split()])
lst_b = sorted([int(x) for x in input().split()])
lst_c = sorted([int(x) for x in input().split()], reverse=True)
a_num = len(lst_a)
b_num = len(lst_b)
c_num = len(lst_c)

ret = 0
for a in lst_a:
    for b in lst_b:
        if a >= b:
            break
        for c in lst_c:
            if c > b:
                ret += 1
            else:
                break
print(ret)
# Judge status: Wrong Answer
def f(n):
    if n % 2 == 0:
        return n/2
    else:
        return 3*n+1


s = int(input())
a_i = s
cnt = 1
while True:
    if a_i == 4:
        break
    cnt += 1
    a_i = f(a_i)
print(cnt+3)
# Judge status: Accepted
a, b, t = map(int, input().split())
print((t//a)*b)
# Judge status: Accepted
import sys

def solve():
    X = int(input())
    for i in range(1, 10**5):
        if i * (i + 1) // 2 >= X:
            minI = i
            break
    print(minI)
    return 0

if __name__ == "__main__":
    solve()
# Judge status: Wrong Answer
X=int(input())
Y=X%100
Z=X//100
if X>(Z*5):
	print(0)
else:
	print(1)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()


def main():
    x, y = map(int, input().split())
    cnt = 0
    while x <= y:
        x *= 2
        cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()
# Judge status: Accepted
s = str(input())

f = "" # 前回のステップの文字 "<" or ">" 
ans = 0 # Answer
count = 0 # Ai
continuous = 0 # ">" が何回連続するか

for m in s:
  if m=="<":
    if f==">" and count>0:
      # 清算
      ans-=count*continuous
      count=0
    count+=1

  else:
    if f=="<":
      # セット
      continuous=0
    count-=1
    continuous+=1
    if count==-1:
      ans+=continuous
      count=0
      continue

  ans+=count
  f=m

print(ans)
# Judge status: Wrong Answer
N = int(input())
ans = (9**N - 2*8**N + 7**N)%(10**9+7)
print(ans)
# Judge status: Accepted
  
a = int(input())
s = input()

if a < 3200:
    print('red')

elif a >= 3200:
    print(s)
# Judge status: Wrong Answer
A, B, C, K = map(int, input().split())

print (A, B, C, K)

sum = 0

if K - A >= 0:
  K -= A
  sum += A
else:
  print(sum)
  exit

if K - B >= 0:
  K -= B
  sum += 0
else:
  sum += 0
  print(sum)
  exit

if K - C >= 0:
  K -= C
  sum += -C
else:
  sum += -1 * K

print (sum)
# Judge status: Accepted
N = int(input())
Alist = list(map(int, input().split()))
boss = {}
for i in Alist:
    if i not in boss:
        boss[i] = 1
    else:
        boss[i] += 1
for j in range(1,N+1):
    if j in boss:
        print(boss[j])
    else:
        print(0)
# Judge status: Wrong Answer
s = input()
s_num = int(s)
len_s = len(s)
list=[0 for x in range(len_s+1)]
for i in range(len_s-1,-1,-1):
    for j in range(4,min(8,len_s-i+1)):
        print(i,j, s[i:j+i])
        if int(s[i:i+j])%2019==0:
            list[i]=list[i+j]+1
print(sum(list))
# Judge status: Wrong Answer
import fractions
N=int(input())
A=list(map(int,input().split()))
A.append(A[0])
ans=0
l=[]
if N==2:
    print(max(A))
    exit()
for i in range(N):
    val=fractions.gcd(A[i],A[i+1])
    l.append(val)
l.sort()
print(l[2])
# Judge status: Wrong Answer
n = int(input())
S = [0]*n
for i in range(n):
    S[i] = int(input())
r = sum(S)
S.sort()
for i in range(n):
    if r%10 == 0 and S[i]%10!=0:
        r -= S[i]
    elif r%10!=0:
        break
print(r)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=0
for i in range(len(a)):
  ai=a[i]
  ans+=b[ai-1]
  if(ans!=b[ai-1]):
    if(ai==before+1):
      ans+=c[before-1]
  before=ai
print(ans)
# Judge status: Wrong Answer
x = input()
x = '000'+x
z = x[-4:-2]
y = x[-2:]
s = 0
z = int(z)
y = int(y)
L = []
for i in range(1,20):
    s +=i
    if s>=y and z>=i:
        print(1)
        exit()
print(0)
# Judge status: Accepted
h,w=map(int,input().split())
if h==1 or w==1:
    print(1)
    exit()
    
if w%2==0:
    print(w//2*h)
    exit()
if w%2==1:
    if h%2==0:
        print(w*h//2)
    elif h%2==1:
        ans=0
        ans+=w*(int(h/2))
        ans+=w//2+1
        print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a_sort=a.sort(reverse=True)
point_a=0
point_b=0
for i in range(0,n,2):
    point_a+=a[i]
for i in range(1,n,2):
    point_b+=a[i]
print(point_a-point_b)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**6)
n = int(input())
readline = sys.stdin.readline
A = [int(i)-1 for i in readline().split()]
B = [int(i) for i in readline().split()]
C = [int(i) for i in readline().split()]

ans = 0
a_prev = -100
for a in A:
    ans += B[a]
    if a == a_prev+1:
        ans += C[a-1]
    a_prev = a
print(ans)
# Judge status: Wrong Answer
import numpy as np 

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

A = np.array(A,np.int64)##Ai<2^60

ans = 0
mod = int(1e9+7)

for i in range(60):
    bottom_bit = (A>>i)&1 ##i回シフトしたときの最下位bit
    ones = sum(bottom_bit[bottom_bit==1])
    ##ans += (N-ones)*ones*(2**i) ##0の個数*1の個数*2^i個
    tmp = 1
    for j in range(i):
        tmp *= 2 % mod
    ans += (N-ones)*ones*tmp % mod

print(ans%mod)
# Judge status: Wrong Answer
n = int(input())
cnt = [[0] * 10 for i in range(10)]
for i in range(1,n+1):
    cnt[int(str(i)[0])][int(str(i)[-1])] += 1

print(cnt)
    
ans = 0
for i in range(10):
    for j in range(10):
        ans += cnt[i][j] * cnt[j][i]
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
A = [input() for i in range(n)]
B = [input() for i in range(m)]

ans = 'No'
for i in range(n - m + 1):
    for j in range(n - m + 1):
        C = []
        for k in range(m):
            C.append(A[i + k][j : j + m])
        if B == C:
            ans = 'Yes'
            
print(ans)
# Judge status: Accepted
def wareru(x,y,z):
  if x%z == 0:
    return y//z - x//z + 1
  else:
    return y//z - x//z

import fractions

a,b,c,d = map(int,input().split())
e = c*d//(fractions.gcd(c,d))
c_hoge = wareru(a,b,c)
d_hoge = wareru(a,b,d)
e_hoge = wareru(a,b,e)
print(b-a+1-c_hoge-d_hoge+e_hoge)
# Judge status: Accepted
n = int(input())
b = list(map(int,input().split()))
a = [0]*n
a[0] = b[0]
a[-1] = b[-1]
for i in range(1,n-1):
    a[i] = min(b[i-1],b[i])
print(sum(a))
# Judge status: Wrong Answer
X,Y=map(int,input().split())
print(abs(X+Y/2))
# Judge status: Accepted
n, m = map(int, input().split())
a = [0]*m
for _ in range(n):
    k = list(map(int, input().split()))
    for i in range(m):
        if i+1 in k[1:]:
            a[i] += 1
ans = 0
for i in range(m):
    if a[i] == n:
        ans += 1
print(ans)
# Judge status: Accepted
import numpy as np
a,b,h,m=map(int,input().split())
pi = np.pi
x = 2*pi*(h*60+m)/720
y = 2*pi*m/60
theta=abs(x-y)
cos = np.cos(theta)
ans = (a**2+b**2-2*a*b*cos)**0.5
print(ans)
# Judge status: Accepted
N = int(input())
S_list = [input() for _ in range(N)]
res_list = ['AC', 'WA', 'TLE', 'RE']

for res in res_list:
    print(res + ' x ' + str(S_list.count(res)))
# Judge status: Accepted
x = int(input())
li = list(map(int, input().split()))
k = 1
s = 0
for i in range(len(li)):
    if k == li[i] :
        k += 1
        s += 1
    if i == len(li)-1 and k == 1:
        s = len(li) + 1
print(len(li)-s)
# Judge status: Accepted
x = int(input())
t = 0
while t*(t+1)/2 < x:
    t += 1

print(t)
# Judge status: Accepted
a = input().split()
if a.count('5')==2 and a.count('7')==1:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**5)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    d = {"SUN": 7, "MON": 6, "TUE": 5, "WED": 4, "THU": 3, "FRI": 2, "SAT": 1}

    print(d[gete()])


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a,b=map(int,input().split())
print(a-(a<b))
# Judge status: Accepted
from collections import deque

K = int(input())
L = deque()
for i in range(9):
    L.append((i+1))

for i in range(K):
    ans = L.popleft()
    if ans % 10:
        L.append(10*ans+ans%10-1)
    L.append(10*ans+ans%10)
    if ans % 10-9:
        L.append(10*ans+ans%10+1)

print(ans)
# Judge status: Wrong Answer
#!/usr/bin/python

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

d1 = input_data[0]
d2 = input_data[1]
d3 = input_data[2]
total = 0

d4 = int(d2 / d1)
if d4 > d3:
    total += 1

print(total)
# Judge status: Wrong Answer
k = int(input())
a, b = map(int, input().split())

if k <= b:
  if a <= k:
    print("OK")
else:
  print("NG")
# Judge status: Wrong Answer
import sys
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def gcd_list(ln):
    tmp = gcd(ln[0], ln[1])
    for x in ln[2:]:
        tmp = gcd(tmp, x)
    return tmp
    
n = int(input())
a = list(map(int, sys.stdin.readline().split()))
if n == 2:
    print(max(a))
else:
    c = [gcd_list(a[:i] + a[i+1:]) for i in range(min(n, 4))]
    c.sort()
    print(c[-1])
# Judge status: Accepted
K,X=map(int,input().split())
print(*list(range(X-K+1,X+K)))
# Judge status: Wrong Answer
def main():
  X = int(input())
  
  i = 1
  
  while i != 0:
    if X % 2 != 0:
      if X % 3 != 0:
        if X % 5 != 0:
          print(X)
          break
    X += 1
  
  
main()
# Judge status: Wrong Answer
lst = [input() for i in range(0, 2)]

n = int(lst[0])
s = lst[1]

if n % 2 == 1:
    print('NO')

t = ''

for i in range(0, n//2):
    t += s[i]

if t + t == s:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n, q = map(int, input().split())
s = input()
t = [0]*(n + 1)
for i in range(n):
    t[i+1] = t[i] + (1 if s[i:i+2] == 'AC' else 0)
for i in range(q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])
# Judge status: Wrong Answer
t = str(input())
t0 = t.replace('?','K')
list = [t0]
i=0
while 'K' in list[i]:

    list.append(list[i].replace('DK','DP').replace('PK','PD'))
    i+=1

print(list[i])
# Judge status: Accepted
def kaisu(n,k):
  if n>=K:
    return k
  else:
    return kaisu(2*n,k+1)
N,K=map(int,input().split())
ans=0
for i in range(1,N+1):
  ans+=pow(2,20-kaisu(i,0))
ans=ans/(pow(2,20))
print(ans/N)
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
ans = 0
from functools import reduce
import fractions
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)
lc = lcm(A)
for i in range(n):
    ans += lc//A[i]
print(ans % (10**9+7))
# Judge status: Accepted
n, c = int(input()), input()

wa = [0] * (n+2)
for i in range(n):
    if(c[i]=='W'): wa[i+1]+=1
for i in range(n+1):
    wa[i+1] += wa[i]

ans = n;
for i in range(n+2):
    w = wa[i]
    r = n-i - (wa[n] - wa[i])
    ans = min(ans, max(w, r))
print(ans)
# Judge status: Accepted
X, N = map(int, input().split())#
p = map(int, input().split())
p = list(p)
tmp = X
Y = X
tmp1 = 0
tmp2 = 0
if X not in p:
  tmp1 = X
for i in range(N):
  if X not in p:
    tmp1 = X
  else:
    X = X + 1
  if Y not in p:
    tmp2 = Y
  else:
    Y = Y - 1
if abs(tmp1 - tmp) >= abs(tmp2 - tmp):
  print(tmp2)
else:
  print(tmp1)
# Judge status: Wrong Answer
n = int(input())
s = input()

ans = 10 ** 10
for i in range(1, n):
    left = s[:i]
    right = s[i + 1:]
    l = list(left).count('W')
    r = list(right).count('E')
    ans = min(ans, l + r)

print(ans)
# Judge status: Wrong Answer
S = input()
l = len(S)

count = 0
harf = int(l/2)
a = S[:harf]
b = S[harf+1:][::-1]

if a == b :
    count+=1

quarter = int(l/2) - 1
a1 = a[:quarter-1]
a2 = a[quarter][::-1]

if a1==a2:
    count+=1

b1 = b[:quarter-1]
b2 = b[quarter][::-1]

if b1 == b2:
    count+=1

if count == 3:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
def palindrome(s):
    n = len(s)
    f = True
    for i in range(n//2):
        if s[i] != s[-(i+1)]:
            f = False
            break
    return f

S = input()
N = len(S)

print("Yes" if palindrome(S[:(N-1)//2]) and palindrome(S[(N+3)//2 - 1:]) else "No")