peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n,m=map(int,input().split())
g=m//2
k=m-g
for i in range(m):
    if i%2==1:
        a=n-g-((i+1)//2)
        b=a+i+1
        print(a,b)
    else:
        a=k-(i//2)
        b=a+i+1
        print(a,b)
# Judge status: Wrong Answer
s = input()
t = input()

s = sorted(s)
t = sorted(t)
l = min([len(s),len(t)])

for i in range(l):
    dec = sorted(s[i] + t[-(i+1)])
    if (dec[0] == t[-(i+1)]) & (dec[0] != s[i]):
        print("No")
        break
    elif (i == l-1) & (len(s) > len(t)):
        print("No")
        break
    else:
        print("Yes")
        break
# Judge status: Accepted
N = int(input())

siritolist = []

for i in range(N):
    W = input()
    siritolist.append(W)

for i in range(1, len(siritolist)):
    back_word = list(siritolist[i-1])
    word = list(siritolist[i])
    if back_word[-1] == word[0] and i > 1:
        for j in range(i-1):
            if siritolist[i] == siritolist[j]:
                print('No')
                exit()
    elif back_word[-1] != word[0]:
        print('No')
        exit()

print('Yes')
# Judge status: Accepted
# Sの入力受付
S = input()
# Sを順に読み込みBがあったとき直前の文字と一緒に消去
STR = ""
for i in S:
    STR = STR + i
    if i == "B" and STR == "":
        STR = ""
    elif i == "B":
        STR = STR[:len(STR) - 2]
print(STR)
# Judge status: Accepted
import sys
import collections

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

N=int(readline())
A=collections.Counter(read().splitlines())

print(len([v for k,v in A.items() if v%2==1]))
# Judge status: Accepted
import math
import itertools

n = int(input())
x, y = [], []
for _ in range(n):
    i, j = map(int, input().split())
    x.append(i)
    y.append(j)

ans = []
for i in itertools.permutations([i for i in range(n)]):
    length = 0
    for j in range(n-1):
        length += math.sqrt((x[i[j]] - x[i[j+1]])**2 + (y[i[j]] - y[i[j+1]])**2)
    ans.append(length)
print(sum(ans)/len(ans))
# Judge status: Accepted
n, k = map(int, input().split())
x = list(map(int, input().split()))

ans = float("inf")
for i in range(n-k+1):
    res = x[i+k-1] - x[i] + min(abs(x[i+k-1]), abs(x[i]))
    ans = min(ans, res)

print(ans)
# Judge status: Wrong Answer
n = int(input())
s = []

for _ in range(n):
    moji = input()
    s.append(moji)

dic = {chr(i): 0 for i in range(97+26)}

for i in range(97, 97+26):
    c = chr(i)
    mini = float('inf')
    for j in s:
        cnt = j.count(c)
        if cnt < mini:
            mini = cnt
    dic[c] = mini

for k, v in dic.items():
    print(k*v, end='')

print()
# Judge status: Wrong Answer
def resolve():
    n = int(input())
    if n==2:
        print("2")
    for j in range(10000):
        flag = 1
        a = int((n+j)**0.5)+1
        for i in range(2, a+1):
            if (n+j) % i== 0:
                flag = -1
            if i == a and flag ==1:
                print(n+j)
                exit()
resolve()
# Judge status: Accepted
s=input()
ACGT=["A","C","G","T"]
moji=[]
for i in range(len(s)):
    #print(moji)
    if s[i] in ACGT:
        moji.append(s[i])
        for j in range(i+1,len(s)):
            if s[j] in ACGT:
                moji[i]+=s[j]
            else:
                break
    else:
        moji.append("")
index=0
for i in moji:
    moji[index]=len(i)
    index+=1
print(max(moji))
# Judge status: Wrong Answer
X = int(input())
#a = int(X**0.2) + 2
if X == 0:
  print(0,0)
else:
  for i in range(-65,65):
    for j in range(-65,65):
      if i==j:
        continue
      else:
        if X%(i-j) == 0:
          if X == i**5 - j**5:
            print(i,j)
            exit()
# Judge status: Accepted
from collections import Counter

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

mod=998244353

c=Counter(d)
max_key=max(d)

if d[0]!=0 or c[0]!=1:
  print(0)
  exit()

ans=1
patterns=1
for i in range(max_key+1):
  p_num=c[i]
  ans*=patterns**p_num
  ans%=mod
  patterns=p_num

print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    a,b,k = map(int,input().split())
    s = list(set(range(a,min(a+k,b+1))) | set(range(max(b-k+1,a),b+1)))
    s = sorted(s)

    for i in range(len(s)):
        print(s[i])


if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

n  =readint()
a = readints()

if n%2==0:
    b = 0
    for i in range(n):
        b^=a[i]
    ans = [b^a[i] for i in range(n)]
else:
    b = a[0]
    ans = [0]+[b^a[i] for i in range(1,n)]

printline(ans)
# Judge status: Accepted
from collections import Counter
n = int(input())
l = [int(input()) for i_ in range(n)]
c = Counter(l)
cnt = 0
for i in c.values():
    cnt+=i%2

print(cnt)
# Judge status: Wrong Answer
n = int(input())
l=[int(input()) for i in range(5)]
num=min(l)
print(n//num + 5)
# Judge status: Accepted
from collections import defaultdict
S = input()[::-1]
mod = 2019
d = defaultdict(int)
ruijo = 1
tmp = 0
for i in range(len(S)):
    tmp += int(S[i]) * ruijo % mod
    d[tmp % mod] += 1
    ruijo *= 10
    ruijo %= mod
ans = 0
for k, v in d.items():
    ans += v * (v - 1) // 2
    if k == 0:
        ans += v
print(ans)
# Judge status: Wrong Answer
X = int(input())

for i in range(100000//100 +1):
    if X >= i*100 and X<= i*106:
        print(1)
        exit()
print(0)
# Judge status: Accepted
s=input()
length = len(s)
ary = []

for i in range(length):
  if s[i] != "B":
    ary.append(s[i])
  elif len(ary) != 0:
    ary.pop(-1)
    
print("".join(ary))
# Judge status: Wrong Answer
a=input()
b=input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if b - a > k or c - a > k or d - a > k or e - a > k or c - b > k or d - b > k or e - b > k or d - c > k or e - c > k or e - d > k:
    print(":(")
else:
    print("Yay!")
# Judge status: Accepted
x, y, z = map(int, input().split() )

cnt = 0
x = x - z

while( x >= y+z ):
  cnt += 1
  x = x - y -z
  
print(cnt)
# Judge status: Accepted
n,k=map(int,input().split())
S=input()
c=0
d=0
for i in range(n-1):
    if S[i]==S[i+1]:
        c+=1
    if S[i]!=S[i+1]:
        d+=1
d=(d+1)//2
print(c+2*d-1 if (d<=k and S[0]!=S[-1]) else c+2*min(d,k))
# Judge status: Accepted
import numpy as np

n = int(input())
A = np.array(input().split(), dtype=np.int64)
money = 1000
kabu = 0

for i in range(n):
    if kabu > 0:
        if i != 0:
            if A[i] > A[i - 1]:
                money += A[i] * kabu
                kabu = 0
    if i != n - 1:
        if A[i] < A[i + 1]:
            kabu += money // A[i]
            money -= A[i] * kabu
print(money)
# Judge status: Accepted
K, A, B = map(int, input().split())
if A + 1 >= B or K < A + 1: result = K + 1
else:
    K -= A-1
    result = A + K//2 * (B - A)
    if K%2 == 1: result += 1
print(result)
# Judge status: Wrong Answer
# A Discount Fare
X, Y = map(int, input().split())
print(X + (Y/2))
# Judge status: Accepted
N = int(input())
vec = list(map(int,input().split()))
vec2 = [i for i in vec]
vec2.sort()
cnt = 0
for i in range(N):
    cnt += vec[i] != vec2[i]
if cnt <= 2:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
d, t, s = map(int, input().split())
if d - t*s <= 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
tt = [0]
xx = [0]
yy = [0]
for i in range(n):
    t,x,y = map(int,input().split())
    tt.append(t)
    xx.append(x)
    yy.append(y)
ans = "Yes"

for i in range(1,n+1):
    dist = abs(xx[i]-xx[i-1]) + abs(yy[i]-yy[i-1])
    time = tt[i]-tt[i-1]
    if time < dist or (time - dist)%2 != 0:
        ans = "No"
        break

print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
d = []
A = []

s0 = set([i for i in range(1,N+1)])
s1 = set()

for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

    for j in range(d[i]):
        s1.add(A[i][j])

s_diff = s0 - s1

print(len(s_diff))
# Judge status: Accepted
# //a(n) = Sum_{k=1..n} k/2 * floor(n/k) * floor(1 + n/k).
n = int(input())
sum=0
for i in range(1, n+1):
	k = i/2
	k=k*(n//i)
	k = k*(1+ (n//i))
	sum+=k
print(int(sum))
# Judge status: Accepted
n, m = map(int, input().split())
dp = [0]*(n+1)
dp[0] = 1
m_list = [int(input()) for _ in range(m)]
for i in range(1,n+1):
  if i==1:
    if m_list and i==m_list[0]:
      m_list.pop(0)
      dp[i]=0
    else:
      dp[i]=1
  elif m_list and i == m_list[0]:
    m_list.pop(0)
    dp[i] = 0
  else:
    dp[i] = (dp[i-1]+dp[i-2])% 1000000007
print(dp[-1])
# Judge status: Accepted
N, Q = map(int, input().split())
S = input()

counts = [0]
c = 0
for i, s in enumerate(S[1:]):
    if (S[i] == 'A') and (s == 'C'):
        c += 1
    counts.append(c)

ans = []
for _ in range(Q):
    l, r = map(int, input().split())
    ans.append(counts[r-1] - counts[l-1])
    #ans.append(S[l-1:r].count('AC'))

for a in ans:
    print(a)
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
X : 一度に焼ける最大個数
T : 焼く時間
N : 必要個数
N個のたこ焼きを作るのに何分必要か？
"""

N, X, T = [int(i) for i in input().split()]
#print(N,X,T)
print(-(-N // X) * T)
# Judge status: Accepted
def ABC_93_A():
    S = input()
    if S.count('a') == 1 and S.count('b') == 1 and S.count('c') == 1:
         print('Yes')
    else:
        print('No')

if __name__ == '__main__':

    ABC_93_A()
# Judge status: Accepted

S=str(input())

T=str(input())

l=len(S)
ans=0
for i in range(l):
    if S[i]!=T[i]:
        ans=ans+1
if ans==0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    mod = 10**9+7
    zero = [0] * 61
    one = [0] * 61
    for i in range(n):
        for j in range(61):
            if a[i]>>j  & 1:
                one[j] += 1
            else:
                zero[j] += 1
    ans = 0
    for i in range(60):
        ans += ((one[i]*zero[i]) * pow(2, i, mod)) % mod
        ans %= mod
    print(ans)
resolve()
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=sorted(a,reverse=True)
alice=sum(b[::2])
Bob=sum(b[1::2])
print(alice-Bob)
# Judge status: Accepted
n = int(input())
mod = 10**9+7
print((10**n-9**n-9**n+8**n)%mod if n >= 2 else 0)
# Judge status: Wrong Answer
N=int(input())
L=list(map(int,input().split()))
L=sorted(L)
K=0
M=sum(L[N:2*N])
for i in range(N):
	K+=L[i*3+1]
print(max(K,M))
# Judge status: Wrong Answer
A, B, C, D = map(int, input().split())

if C <= B <= D: 
	print(max(0,B-C))
elif C <= D <= B:
	print(max(0,D-C))
else:
	print(0)
# Judge status: Wrong Answer
import math
a,b = map(float,input().split())
c = a * b
ans = math.floor(c)
print(int(ans))
# Judge status: Wrong Answer
import re
S=input()
patterns=[]
keyence = "keyence"
for i in range(1,len(keyence)):
    patterns.append(keyence[:i]+'[a-z]*'+keyence[i:])
for p in patterns:
    if re.match(p,S):
        print('YES')
        exit()
print('NO')
# Judge status: Accepted
x, a, b = map(int, input().split())
if abs(x - a) < abs(x - b):
  print('A')
else:
  print('B')
# Judge status: Wrong Answer
x=int(input())
happiness=0
if(x>500):
	sum_amount=x//500
	happiness+=sum_amount*1000
	diff=x-happiness/2	
	z=int(diff/5)
	happiness+=z*5
	print(happiness)	

elif(x<500):
	k=int(x/5)
	ans=k*5
	print(ans)
# Judge status: Wrong Answer
N = int(input())
if (N*100)%108 == 0 :
    print(N/1.08)
else :
    for i in range(1,100) :
        if (N*100+i) % 108 == 0 :
            print((N*100+i)/108)
            break
    else :
        print(":(")
# Judge status: Accepted
n = int(input())
c = 0
for i in range(1, (n // 2) + 1):
    if i ** 2 >= n:
        break
    if n % i == 0:
        a = n // i - 1
    else:
        a = n // i
    c += 2 * (a - i) + 1
print(c)
# Judge status: Accepted
a, b, c = map(int, input().split())
print('Yes' if (a < c < b) or (b < c < a) else 'No')
# Judge status: Wrong Answer
a,b=map(int,input().split())
print(int(a%b))
# Judge status: Wrong Answer
if __name__ == "__main__":
    n, a, b = list(map(int, input().split()))

    ans = 0

    if b > a and n > 2:
        ans = (n - 2) * b - (n - 2) * a + 1
    elif n == 1 and a == b:
        ans = 1
    elif n == 2 and b >= a:
        ans = 1

    print(ans)
# Judge status: Wrong Answer
s = input()
t = input()

n = len(s)
m = len(t)
ans = m
for i in range(n-m):
  p = 1
  for j in range(i,m):
    if s[i+j] == t[j]: p += 1
    else: break
  if m-p < ans: ans = m-p
print(ans)
# Judge status: Wrong Answer
n=input()
l=len(n)
k=0
for i in range(l):
    for j in range(i,l):
        if n[i]!=n[j]:
            k=1
            
if k==1:
    if n[0]>n[1]:
        print(n[0]*l)
    else:
        print((str(int(n[0])+1))*l)
        
else:
    print(n)
# Judge status: Accepted
# -*- coding: utf-8 -*-
n = int(input())
s = [input() for _ in range(n)]

print(len(set(s)))
# Judge status: Wrong Answer
n=int(input())
ans=10**n-2*9**n+8**n
print(ans)
# Judge status: Accepted
N, X, T = map(int, input().split())

a = int(N / X)
if N % X == 0:
    a = a
else:
    a = a + 1
print(a * T)
# Judge status: Accepted
n = int(input())
r = []
for i in range(n):
    x, l = map(int, input().split())
    r.append((x - l, x + l))
r.sort(key=lambda _x: _x[1])
cnt = 1
limit = r[0][1]
for ri in r[1:]:
    if ri[0] >= limit:
        cnt += 1
        limit = ri[1]
print(cnt)
# Judge status: Accepted
list1 = input().split(' ')
list2 = input().split(' ')
list2 =  [int(s) for s in list2]

num = int(list1[1])
HP = int(list1[0])
D = 0
for N in list2:
  D += N

if D >= HP:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N=int(input())
if N%2==1:
    print(0)
else:
    ans=0
    N//=2
    i=1
    while N >= 5**i :
        ans+=N//(5**i)
        i+=1
    print(ans)
# Judge status: Accepted
N = int(input())
ans = 0
for i in range(1,N+1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)
# Judge status: Wrong Answer
import collections
def resolve():
    n = int(input())
    S0 = sorted(list(input()))
    dic = collections.Counter(S0)

    for i in range(n-1):
        S = list(input())
        for k, v in dic.items():
            cnt = S.count(k)
            dic[k] = min(v, cnt)

    ans = ''
    for k, v in dic.items():
        ans += k * v
    print(ans)

if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
r, g, b = map(int, input().split())
if g*10 + b % 4 == 0:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n, m = map(int, input().split())
if n == m:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
ps = list(map(int, input().split()))

cnt = 0
for i in range(n - 1):
    if ps[i] == i + 1:
        ps[i], ps[i + 1] = ps[i + 1], ps[i]
        cnt += 1
        
if ps[n - 1] == n:
    cnt += 1
print(cnt)
# Judge status: Accepted
N = int(input())
from math import sqrt, floor
for i in range(1,floor(sqrt(N))+2):
    if i**2 > N:
        print((i-1)**2)
# Judge status: Accepted
n = input()
t = len(n)+1
dp1 = [0] * t
dp2 = [0]*t
dp2[0] = 1

for i in range(t-1):
    x = int(n[i])
    dp1[i + 1] = min(dp1[i] + x, dp2[i] + 10 - x)
    x += 1
    dp2[i+1] = min(dp1[i]+x, dp2[i]+10-x)
print(dp1[-1])
# Judge status: Wrong Answer
n,x,y = map (int ,input().split())

x = x-1
y = y-1

dict = {int(i+1):0 for i in range(n)}

ans = 0
for i in range(n):
    for j in range(n):
        if i < j:
            ans = min(j-i,abs(i-x)+abs(j-y)+1,abs(i-y)+abs(j-x)+1)
            print(ans,i,j)
            dict[ans] +=1
            
print(dict)
# Judge status: Wrong Answer
s = input()
if(s =="ABC"):
  print("ARC")
else:
  print("ARC")
# Judge status: Accepted
N = int(input())
txy = [[0, 0, 0]]
for i in range(N):
  txy.append(list(map(int, input().split())))

for i in range(N):
  dt = txy[i+1][0] - txy[i][0]
  dx = txy[i+1][1] - txy[i][1]
  dy = txy[i+1][2] - txy[i][2]
  
  if dt < abs(dx + dy):
    print('No')
    break
  else:
    if (dt - (dx + dy)) % 2 != 0:
      print('No')
      break
else:
  print('Yes')
# Judge status: Wrong Answer
h,n=map(int,input().split())
dp=[10**10]*(h+1)
dp[0]=1
X=[]
for i in range(n):
    a,b=map(int,input().split())
    X.append([a,b])


for i in range(h):
    for j in range(n):
        k=min(i+X[j][0],h)
        dp[k]=min(dp[k],dp[i]+X[j][1])
print(dp[h])
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
count = 0
while all([x % 2 == 0 for x in A]):
    A = [x / 2 for x in A]
    count += 1

print(count)
# Judge status: Accepted
S,T = input().split()
A,B = map(int,input().split())
U = input()
count_S = U.count(S)
count_T = U.count(T)


S_amount = A - count_S
U_amount = B - count_T

print(S_amount,U_amount)
# Judge status: Accepted
N=int(input())
ans=0
for i in range(1,N+1):
    if len(str(i))%2==1:
        ans+=1
print(ans)
# Judge status: Accepted
a,b=map(str,input().split())
a=int(a)
b=100*int(b[0])+10*int(b[2])+1*int(b[3]) #bを100倍した値(整数)に直す
print((a*b)//100)
# Judge status: Accepted
n = int(input())
d = list(map(int,input().split()))
sorted_d = sorted(d)

halfLength = int(len(sorted_d) / 2)

if sorted_d[halfLength-1] ==  sorted_d[halfLength]:
	print(0)
else:
	print(sorted_d[halfLength] - sorted_d[halfLength-1])
# Judge status: Accepted
def resolve():
    import sys

    input = lambda: sys.stdin.readline().rstrip()

    s = input()
    t = input()
    print("Yes" if t.startswith(s) else "No")



resolve()
# Judge status: Wrong Answer
h1, m1, h2, m2, K = list(map(int, input().split()))
print(h2-h1*60 + m2-m1 - K)
# Judge status: Accepted
a, b, c = map(int, input().split())

print(max(c-(a-b),0))
# Judge status: Accepted
N = int(input())
s = input().strip()
t = input().strip()
k = 0
for i in range(1,N+1):
    if s[-i:]==t[:i]:
        k = i
        continue
print(2*N-k)
# Judge status: Accepted
a, b, c, d = map(int, input().split())
start = max([a, c])
end = min([b, d])
r = end - start
if r < 0:
	r = 0
print(r)
# Judge status: Accepted
w = ("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT")
s = input()
print((w.index(s) -7) * -1)
# Judge status: Wrong Answer
x = int(input())

c500, r500 = map(int, divmod(x, 500))
c5 = int(x % 5)

ans1 = c500 * 1000 + c5 * 5

print(c500 * 1000 + c5 * 5)
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))
ans = 0
now = 0
for i in range(1, N):
	if H[i - 1] >= H[i]:
		now += 1
		ans = max(ans, now)
	else:
		now = 0
print(ans)
# Judge status: Accepted
N=int(input())
x=[0 for i in range(N)]
y=[0 for i in range(N)]
for i in range(N):
    x[i],y[i]=map(int,input().split())
A=[(x[i],y[i]) for i in range(N)]
B=[(x[i],y[i]) for i in range(N)]
A.sort(key=lambda p:p[0]+p[1])
B.sort(key=lambda p:p[0]-p[1])
def dist(a,b):
    return abs(a[0]-b[0])+abs(a[1]-b[1])
ans0=dist(A[0],A[-1])
ans1=dist(B[0],B[-1])
print(max(ans0,ans1))
# Judge status: Wrong Answer
N, K = map(int, input().split())
As = list(map(int, input().split()))

for i in range(K):
  nextA = [0 for _ in range(N)]
  for j in range(N):
    lamps = [int(max(0,j-As[j])<=k<=j+As[j]) for k in range(N)]
    nextA = [x+y for x, y in zip(nextA, lamps)]
  As = nextA
  print(As)
# Judge status: Accepted
# ABC 093: B – Small and Large Integers
a, b, k = [int(s) for s in input().split()]
nums = []

if k >= b - a + 1:
    nums = list(range(a, b + 1))
else:
    nums = list(set(list(range(a, a + k)) + list(range(b - k + 1, b + 1))))
    nums.sort()

for num in nums:
    print(num)
# Judge status: Accepted
import math
n = int(input())
s = int(math.sqrt(n))
print(s**2)
# Judge status: Accepted
from operator import itemgetter
n,m = map(int, input().split())
input_list = []
for _ in range(n):
    i,j = map(int, input().split())
    d = {'price': i, 'amount': j}
    input_list.append(d)

total = 0
target = m
sorted_list = sorted(input_list, key=itemgetter('price'))
for dic in sorted_list:
    price = dic['price']
    amount = dic['amount']
    if target <= amount:
        total += target*price
        break
    else:
        total += amount*price
        target -= amount
print(total)
# Judge status: Accepted
N = int(input())

ans = ' '
while N>0:
    N -= 1
    ans += chr(ord('a')+N%26)
    N = int(N/26)
    
print(ans[::-1])
# Judge status: Wrong Answer
def resolve():

    from collections import Counter

    n = int(input())

    words = [input() for i in range(n)]
    words.sort()

    word_counter = Counter(words)

    max_count = word_counter.most_common()[0][1]
    
    for c in word_counter.most_common() :
        if c[1] == max_count:
            print(c[0])

            
resolve()
# Judge status: Wrong Answer
def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors, upper_divisors


n = int(input())
low, up = make_divisors(n)
if up:
    print(low[-1] - 1 + up[-1] - 1)
else:
    print(n - 1)
# Judge status: Accepted
n = int(input())
w = list()
f = input()
w.append(f)
cnt = 0
for i in range(1, n):
    x = input()
    a = w[i-1]
    if a[-1] == x[0]:
        if x not in w:
            cnt += 1
            w.append(x)
            if cnt == n-1:
                print("Yes")
                break
        else:
            print("No")
            break
    else:
        print("No")
        break
# Judge status: Wrong Answer
n=list(map(int,str(input())))

k=len(n)
count=0
tmp=0
for i in range(1,k):
  if n[-i]==10:
    n[-i] = 0
    n[-i-1] += 1
  now = int(n[-i])
  if now > 5:
    count += 10-now
    n[-i-1] += 1
  else:
    count += now
  print(n[-i],n[-i-1])
  

now= int(n[0])
if now == 10:
  count += 1
elif now > 5:
  count += 10-now+1
else:
  count += now
    
print(count)
# Judge status: Accepted

def main():
    N, K = input().split(" ")

    D = list(input().split(" "))
    use_num = list(set([str(i) for i in range(10)]) - set(D))

    N = int(N)
    i = N
    while True:

        if not set(str(i)) <= set(use_num) and i >= N:
            i += 1
        else:
            print(i)
            break

if __name__ == "__main__":
    main()
# Judge status: Accepted
N, M = map(int, input().split())

X = 10 ** 9 + 7
ans = 0

if N - M < 2:
    if N == M:
        ans = 2
    elif abs(N - M) == 1:
        ans = 1

    for i in range(N):
        ans *= N - i
        ans %= X
    for i in range(M):
        ans *= M - i
        ans %= X

print(ans)
# Judge status: Wrong Answer
#TLE
n = int(input())
a = input().split()
dic = {}
ans = 0
for i in range(n):
    if a[i] in dic:
        ans += dic[a[i]]
    else:
        num = a.count(a[i]) - 1
        ans += num
        dic[a[i]] = num
ans /= 2
for i in range(n):
    print(int(ans - dic[a[i]]))
print(dic)
# Judge status: Accepted
import bisect
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

SA = [0]*(N+1)
SB = [0]*(M+1)
T = 0


ans = 0

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

for i in range(M):
    SB[i+1] = SB[i] + B[i]

for i in range(N+1):
    if SA[i] > K:
        break
    id = bisect.bisect_right(SB, K - SA[i]) - 1
    ans = max(ans, i + id)


print(ans)
# Judge status: Accepted
N, M = map(int, input().split())

roads = [ list(map(int, input().split())) for _ in range(M)]

maps = [0 for _ in range(N+1)]

for road in roads:
    maps[road[0]] += 1
    maps[road[1]] += 1

for i in range(1, N+1):
    print(maps[i])
# Judge status: Accepted
n = input()
s = input()
x = s
# '()' を取り除いておく.
while '()' in x:
    x = x.replace('()','')
# '(' はつけるとしても一番左
# ')' はつけるとしても一番右
print('(' * x.count(')') + s + ')' * x.count('('))
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
if N==M:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if a==b==c:
    print(-1)
    exit()
cnt=0
while True:
    x=(b+c)//2
    y=(a+c)//2
    z=(a+b)//2
    a,b,c = x,y,z
    cnt+=1
    if a%2 != 0 or b%2 != 0 or c%2 !=0:
        break
print(cnt)