peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
input = sys.stdin.readline


def read():
    S = input().strip()
    T = input().strip()
    return S, T


def solve(S, T):
    s = ''.join(sorted(S))
    t = ''.join(reversed(sorted(T)))
    return "Yes" if s < t else "No"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))
# Judge status: Accepted
n, m = map(int, input().split())
listAC = [0] * n
listWAAC = [0] * n
listWA = [0] * n
for i in range(m):
    p, s = map(str, input().split())
    p = int(p) - 1
    if listAC[p] == 1:
        continue
    if s == 'AC':
        listAC[p] += 1
        listWAAC[p] += listWA[p]
        continue
    listWA[p] += 1

print(sum(listAC), sum(listWAAC))
# Judge status: Wrong Answer
x = int(input())

dp = [0]*200000

def max_sum():
  global dp
  for i in range(x):
    for j in range(6):
      dp[i+100+j] += 1
  return


max_sum()

print(min(dp[x], 1))
# Judge status: Accepted
n = int(input())
a = [int(input()) for _ in range(n)]
b = sorted(a,reverse=True)


for i in range(n):
    if a[i] == b[0]:
        print(b[1])
    else:
        print(b[0])
# Judge status: Wrong Answer
I=input().split()
 
if I[0]=="5" and I[1]=="7" and I[2]=="5":
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
def is_prime(n):
    if n == 1:
        return False

    i = 2
    while True:
        if i ** 2 >= n:
            return True
        if n % i == 0:
            return False
        i += 1

x = int(input())
for i in range(x+1, x ** 2):
    if is_prime(i):
        print(i)
        break
# Judge status: Wrong Answer
_N, _M = map(int, input().split())
N = max(_N, _M)
M = min(_N, _M)
if N >= 3 or M >= 3:
    long = max(1, N - 2)
    short = max(1, M - 2)
    print(long * short)
else:
    print(0)
# Judge status: Accepted
l, r, d = map(int, input().split())
count = 0
for i in range(l, r+1):
  if i % d == 0:
    count += 1
print(count)
# Judge status: Accepted
A = list(map(int, input().split()))

ans = 10**1000
tmp = 0

for i in range(2):
    for j in range(i+1, 3):
        tmp = A[i] + A[j]
        ans = min(ans, tmp)

print(ans)
# Judge status: Wrong Answer
n, m = map(int , input().split())
am = [list(map(int,input().split())) for _ in range(m)]

route = {}
for a in am:
  if a[0] in route:
    route[a[0]] += 1
  else :
    route[a[0]] = 1
  if a[1] in route:
    route[a[1]] += 1
  else :
    route[a[1]] = 1 

routes = sorted(route.items())
for r in routes:
  print(r[1])
# Judge status: Accepted
def num2alpha(num):
  if num<=26:
    return chr(64+num)
  elif num%26==0:
    return num2alpha(num//26-1)+chr(90)
  else:
    return num2alpha(num//26)+chr(64+num%26)

print(num2alpha(int(input())).lower())
# Judge status: Wrong Answer
n = int(input())
c = [[int(i) for i in input().split()] for i in range(n)]
x_0 = c[0][0]
y_0 = c[0][1]
x_1 = c[1][0]
y_1 = c[1][1]
l = abs(x_0 - x_1) + abs(y_0 - y_1)
for i in range(1,n):
    x = c[i][0]
    y = c[i][1]
    l0 = abs(x_0 - x) + abs(y_0 - y)
    if l < l0:
        l = l0
        x_0 = x
        y_0 = y
print(l)
# Judge status: Wrong Answer
import collections

n = int(raw_input())
p = map(int,raw_input().split(' '))
q = map(int,raw_input().split(' '))


elems = range(1, n+1)
res = {}
c = [0]
def perms(i, elems,res, c):

	if i == len(elems):
		res[tuple(elems)] = c[0]
		c[0]+=1
		return 
	for j in range(i, len(elems)):
		elems[j], elems[i] = elems[i], elems[j]
		perms(i+1, elems, res, c)
		elems[j], elems[i] = elems[i], elems[j]

perms(0, elems, res, c)

print abs((res[tuple(p)] - res[tuple(q)]))
# Judge status: Accepted
a, b, c = map(int, input().split())
if b - a == c - b:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
A, B, C, D = input().split(" ")
A, B, C, D = int(A), int(B), int(C), int(D)

while True:
    C -= B
    if C <= 0:
        print("Yes")
        break
    A -= D
    if A <= 0:
        print("No")
        break
# Judge status: Accepted
N = int(input())
print((10**N - 2*9**N + 8**N)%1000000007)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
max = max(a)
min = min(a)
cost_min = n * (max - min)**2
for m in range(min, max+1):
    cost = 0
    for x in a:
        cost += (x - m)**2
    if cost < cost_min:
        cost_min = cost
print(cost_min)
# Judge status: Accepted

N = int(input())
count_ac = 0
count_wa = 0
count_tle = 0
count_re = 0
for i in range(N):
    S = input()
    if S == "AC":
        count_ac += 1
    if S == "WA":
        count_wa += 1
    if S == "TLE":
        count_tle += 1
    if S == "RE":
        count_re += 1
    del S

print("AC x ",count_ac)
print("WA x ",count_wa)
print("TLE x ",count_tle)
print("RE x ",count_re)
# Judge status: Wrong Answer
li = list(input())
od = li[0::2]
ev = li[1::2]

for i in range(len(od)):
    if od[i] == "L" or od[i] == "U" or od[i] == "D":
        pass
    else:
        print("No")
        exit()
for j in range(len(ev)):
    if ev[j] == "R" or ev[j] == "U" or ev[j] == "D":
        pass
    else:
        print("No")
        exit()
        
print("Yes")
# Judge status: Wrong Answer
S = input()
s = int(S)
lis = [s]

def func(n):
    if n%2 == 0:
        return n//2
    else:
        return 3*n+1
 
while func(s) !=1:
    print(func(s))
    s = func(s)
    lis.append(s)

if S == "1":
    print(4)
elif s == "2":
    print(4)
elif s == "4":
    print(4)
else:
    print(len(lis)+2)
# Judge status: Wrong Answer
import sys

N,M=map(int,input().split())
A=[sys.stdin.readline().strip() for _ in range(N)]
B=[sys.stdin.readline().strip() for _ in range(M)]

for i in range(N-M):
  for j in range(N-M):
    As=[x[j:j+M] for x in A[j:j+M]]
    if B==As:
      print('Yes')
      sys.exit()
print('No')
# Judge status: Accepted
li = list(map(int, input().split()))
print(len(set(li)))
# Judge status: Accepted
N, L = map(int, input().split())
s = [input() for _ in range(N)]
ans = ""

s.sort()
for si in s:
    ans += si
print(ans)
# Judge status: Accepted
N = int(input())
d = [int(input()) for i in range(N)]
cnt=1
a=d[0]
if a==2:
    print(cnt)
    exit()

for _ in range(N):
    a=d[a-1]
    cnt+=1
    if a==2:
        print(cnt)
        exit()
print(-1)
# Judge status: Accepted
c = str.lower(input())

def answer(c: str) -> str:
    n = ('a', 'e', 'i', 'o', 'u')

    if c in n:
        return 'vowel'
    else:
        return 'consonant'

print(answer(c))
# Judge status: Wrong Answer
a = int(input())
print(3.1415 * a *a)
# Judge status: Accepted
a,b=map(int,input().split())
try:
	s=input()
	sa=int(s[:a])
	ss=s[a]
	sb=int(s[a+1:])
	print("Yes" if ss=='-' else "No")
except:
	print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = [0] * 9
for ai in a:
    if ai // 400 > 7:
        ans[8] += 1
    else:
        ans[ai // 400] = 1

print(max(1, sum(ans[:-1])), sum(ans))
# Judge status: Wrong Answer
a,b = map(int,input().split())
n = input()
if n[a]=="-":
  if n[0:a-1].isdecimal() and n[a+1:b].isdecimal():
    print("Yes")
    exit()
print("No")
# Judge status: Accepted
a, b = map(int, input().split())

print(a - int(a > b))
# Judge status: Accepted
s = input()
a = ""
for i in range(len(s)):
    a += "x"
print(a)
# Judge status: Wrong Answer
seq = range(int(input()))
result = 0
for i in seq:
  if not i % 3 == 0 or i % 5 == 0 or i % 15 == 0:
    result += i
print(result)
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
count1 = len([x for x in l if x%2 != 0])
count2 = len([x for x in l if (x%4 != 0) and (x%2 == 0)])
count4 = len([x for x in l if x%4 == 0])
print ("Yes") if (n - (count4*2) <= count2) or count4 >= n//2 else print ("No")
# Judge status: Accepted
N = input()
if N.find('9') != -1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N ,*A  = map(int,open(0).read().split())

L = [0 for i in range(N+1)]
D = [0 for i in range(N)]

for i,a in enumerate(A,1):
  L[i] = L[i-1] + a
for i in range(N):
  D[i] = L[-1]-L[i]
#L.pop(0)
  
#print(L)
#print(D)
ans = 1e19
for i in range(N):
  #print(L[i],D[i],L[i]-D[i])
  ans = min(abs(L[i]-D[i]),ans)
print(ans)
# Judge status: Accepted
import math
X, Y = map(int,input().split())

ans = 0

while X <= Y:
  X = X*2
  ans +=1
print(ans)
# Judge status: Accepted
#<ABC151>
#<A>
s = input()
s = ord(s)
s = s + 1
print(chr(s))
# Judge status: Accepted
N = int(input())

if N <= 999:
    print('ABC')
else:
    print('ABD')
# Judge status: Accepted
S = list(input())
for i in range(2 ** 3):
    pm = ['-'] * 3
    for j in range(3):
        if i >> j & 1:
            pm[j] = '+'
    ans = [None] * 7
    ans[::2] = S
    ans[1::2] = pm
    ans = ''.join(ans)
    if eval(ans) == 7:
        print(ans + '=7')
        break
# Judge status: Wrong Answer
n,m=map(int,input().split())

from math import factorial

if n==m:
	ans = factorial(n)*factorial(m)*2
else:
	ans = factorial(n)*factorial(m)
print(ans%(10**9+7))
# Judge status: Accepted
k = int(input())
a,b = map(int,input().split())

target = a
res = 'NG'
while target <= b:
    if target % k == 0:
        res = 'OK'
    target += 1
print(res)
# Judge status: Wrong Answer
x = int(input())

a, b = divmod(x, 500)
c = b // 5

print(a + c)
# Judge status: Wrong Answer
n = int(input())
for i in range(10):
  for j in range(10):
    if i * j ==n:
      print("Yes")
else:
  print("No")
# Judge status: Accepted
a, b, k = map(int, input().split())

used = set()
for i in range(a, min(a+k, b)):
  print(i)
  used.add(i)
for i in range(max(a, b-k+1), b+1):
  if not i in used:
    print(i)
# Judge status: Accepted
s = int(input())
mod = 10**9+7
dp = [0]*(s+1)
dp[0] = 1
for i in range(1, s+1):
    for j in range(0, (i-3)+1):
        dp[i] += dp[j]
        dp[i] %= mod
print(dp[s])
# Judge status: Accepted
import bisect
n = int(input())
A = sorted(list(map(int, input().split())))
B = list(map(int, input().split()))
C = sorted(list(map(int, input().split())))
cnt = 0
for i in range(n):
    a = bisect.bisect_left(A, B[i])
    c = bisect.bisect_right(C, B[i])
    cnt += a * (n-c)
print(cnt)
# Judge status: Accepted
a,b,c = map(int,input().split())
count = 0
while(True):
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
        break
    a0 = a
    b0 = b
    c0 = c
    a = (b0+c0)/2
    b = (c0+a0)/2
    c = (a0+b0)/2
    count += 1
    if a0 == a and b0 == b and c0 == c:
        count = -1
        break
print(count)
# Judge status: Accepted
from collections import defaultdict
p = defaultdict(int)
for q in range(int(input())):
    a = int(input())
    p[a] += 1
ans = 0
for q in p.values():
    ans += 1 if q % 2 else 0
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
d = list(input().split())

flag = True
while True:
    strn = str(n)
    for i in d:
        if i in strn:
            n += 1
            break
    else:
        flag = False
        break

print(n)
# Judge status: Wrong Answer
N = input()
A = list(input().split())
A = list(map(int,A))
A = sorted(A,reverse = True)
a = 0
b = 0
try :
  while len(A) != 0 :
    a += A.pop(0)
    b += A.pop(0)
except IndexError :
  print(a-b)
print(a-b)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
cnt = 0
m = float('inf')
for i in range(n):
    if a[i] < 0:
        cnt += 1
    if abs(a[i]) < m:
        m = abs(a[i])
ans = 0
for i in range(n):
    ans += abs(a[i])
if cnt % 2 == 1:
    ans -= m * 2
print(ans)
# Judge status: Accepted
s=list(input())

if s[0]=="A":
    if s[2:-1].count("C")==1:
        if s[1]==s[1].lower() and s[-1]==s[-1].lower():
            print("AC")
            exit()

print("WA")
# Judge status: Wrong Answer
x = int(input())

if x >= 100:
    print(1 if x % 100 <= x / 100 * 5 else 0)
else:
    print(0)
# Judge status: Accepted
l=input().split()
print(l[0][0]+l[1][0]+l[2][0])
# Judge status: Wrong Answer
s=input()
print(chr(ord(s)+32))
# Judge status: Wrong Answer
n,c,k = map(int,input().split())
t = [int(input()) for _ in range(n)]
t.sort()
cnt = 0
ans = 0
end = -1
for i,t in enumerate(t):
  if end <= t:
    cnt = 1
    ans +=1
    end = t+k
  else:
    cnt +=1
  if cnt > c:
    cnt = 1
    ans +=1
    end = t+k
#  print("i",i,"t",t,"cnt",cnt,"ans",ans,"end",end)
print(ans)
# Judge status: Accepted
A, B, C = map(int, input().split())
K = int(input())

tmp = K
for i in range(K):
  if A < B:
    tmp = i
    break
  B = B * 2
  
if B < C:
  print('Yes')
elif B < C * (2 ** (K - tmp)):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
s = input()
n = len(s)

if s != s[::-1]:
    print('No')
    exit()

s2 = s[:int((n-1)/2)]
if s2 != s2[::-1]:
    print('No')
    exit()

s3 = s[int((n+3)/2-1):]
if s3 != s3[::-1]:
    print('No')
    exit()

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

ans = []
for i in range(k):
    ans.append(a+i)
    ans.append(b-i)
    
ans = sorted(set(ans))
for i in ans:
    print(i)
# Judge status: Wrong Answer
n = int(input())
w = [int(i) for i in input().split()]
ans = 0
for i in range(n - 1):
    ans = min(ans, abs(sum(w[:i + 1]) - sum(w[i + 1:])))
print(ans)
# Judge status: Wrong Answer
s = input()

n = 3
for i in range(2**n):
    ans = s[0]
    sum = int(s[0])
    for j in range(3):
        if 1 & (i >> j):
            ans += f'+{s[j+1]}'
            sum += int(s[j+1])
        else:
            ans += f'-{s[j+1]}'
            sum -= int(s[j+1])
    if sum == 7:
        print(f'{ans}+7')
        exit()
# Judge status: Wrong Answer
N, M = map(int, input().split())
l = [list(map(int, input().split())) for i in range(N)]
m = []
for i in range(1, l[0][0] + 1):
    m.append(l[0][i])
for i in range(1, N):
    for j in m:
        
        if l[i][1:].count(j) == 0:
            m.remove(j)
            
print(len(m))
# Judge status: Accepted
#048_C
n,x=map(int,input().split())
a=list(map(int,input().split()))
ans=0

for i in range(n):
    if i==0:
        if a[i]>x:
            ans+=a[i]-x
            a[i]=x
    else:
        if a[i-1]+a[i]>x:
            ans+=a[i-1]+a[i]-x
            a[i]=x-a[i-1]
print(ans)
# Judge status: Wrong Answer
a,b,c= input().split()
x,y,z=(int(a),int(b),int(c))
print(int(x*y))
# Judge status: Accepted
S=input()
tmp = S[0]
n = ""
ans = 1
for i in S[1:]:
    n += i
    if tmp != n:
        ans += 1
        tmp = n
        n = ""
print(ans)
# Judge status: Accepted
N=int(input())
NT=N
cnt=0
ans=0
while NT//10:
  cnt+=1
  NT//=10
if cnt==0:
  ans=N
if cnt==1:
  ans=9
if cnt==2:
  ans=N-90
if cnt==3:
  ans=909
if cnt==4:
  ans=909+(N-9999)
if cnt==5:
  ans=90909
print(ans)
# Judge status: Accepted
card = []
for i in range(3):
    row = list(map(int,input().split()))
    card.append(row)

n = int(input())
ans = False

for i in range(n):
    b = int(input())
    for  j in range(3):
        if b in card[j]:
            card[j][card[j].index(b)] = 0

def judge(lst):
    return lst == [0,0,0]

for i in range(3):
    ans |= judge(card[i])
for i in range(3):
    ans |= judge([card[j][i] for j in range(3)])
ans |= judge([card[i][i] for i in range(3)])
ans |= judge([card[i][2-i] for i in range(3)])

print("Yes" if ans else "No")
# Judge status: Accepted
import math

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

theta_a = math.pi/6 * (H+M/60)
theta_b = math.pi*2*M/60

ans = math.sqrt((b*math.cos(theta_b) - a*math.cos(theta_a))**2 + (b*math.sin(theta_b) - a*math.sin(theta_a))**2)

print(ans)
# Judge status: Wrong Answer
n = int(input())
s = input()
cnt = 1

for i in range(n):
    c = 0
    s1 = s[i:]
    s2 = s[:i]
    S = set(s1)

    for j in S:
        if j in s2:
            c += 1
    cnt = max(cnt, c)

print(cnt)
# Judge status: Wrong Answer
N,K = map(int,(input().split()))
h = [int(input())for _ in range(N)]
h = sorted(h)

hmax = 0
hmin = 10**18

for i in range(K):
    hmax = max(h[i],hmax)
    hmin = min(h[i],hmin)
print(hmax-hmin)
# Judge status: Wrong Answer
D = [i for i in range(10)]
N,K = map(int,input().rstrip().split(" "))
A = list(map(int,input().rstrip().split(" ")))
A.reverse()
ans = 100000
for i in A:
    D.pop(i)
print(D)
p = len(D)
for i in range(p ** 5 + 1):
    R = 0
    for i2 in range(6):
        if i > p ** i2:
            R += D[(i // (p ** i2)) % p] * 10 ** i2
    if R >= N and R < ans:
        ans = R
        break
print(ans)
# Judge status: Wrong Answer
n = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
for i in range(n):
  for j in range(i+1, n):
    for k in range(j+1, n):
      if i + j > k :
        ans += 1
print(ans)
# Judge status: Accepted
from math import ceil
n = int(input())
pf = []
t = n
if n == 1:
    print(0)
    exit()
for i in range(2, ceil(n ** 0.5) + 1):
    c = 0
    while t % i == 0:
        c += 1
        t //= i
    if c > 0: pf.append(c)
if t != 1: pf.append(1)

ans = 0
for i in pf:
    tmp = i
    j = 1
    while j <= tmp:
        tmp -= j
        ans += 1
        j += 1
print(ans)
# Judge status: Accepted
def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False


n, a, b = map(int, input().split())
tables = [n] * 2
if is_even(a) and is_even(b):
    print(abs(a - b) // 2)
elif not is_even(a) and not is_even(b):
    print(abs(a - b) // 2)
else:
    print(min(abs(1 - a), abs(b - n)) + 1 + (b - a - 1) // 2)
# Judge status: Accepted
K = int(input())
S = input()

if len(S) <= K:
    print(S)

else:
    SS = S[0:K]
    print(SS + "...")
# Judge status: Accepted
N, K = map(int, input().split(' '))
R, S, P = map(int, input().split(' '))
T = list(input())
score = 0
A = T
for i in range(N-K):
  if T[i] == T[i+K]:
    A[i+K] = 'a'

for i in range(N):
  if A[i] == 'r':
    score += P
  elif A[i] == 's':
    score += R
  elif A[i] == 'p':
    score += S
print(score)
# Judge status: Wrong Answer
s = input()
t = input()

cnt = []
for i in range(len(t)):
    for k in range(i + 1, len(t) + 1):
        if t[i:k] in s[i:]:
            cnt.append(k - i)
        else:
            cnt = [0]
            #print(t[i:k], k - i)
#print(cnt)
print(len(t) - max(cnt))
# Judge status: Wrong Answer
import collections

s = input()
cnt = collections.Counter()

for i in s:
    cnt[i] += 1


if all([True if i % 2 == 0 else False for i in cnt.values()]):
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
s = input()
t = input()
l = len(t)

flag = False
for i in range(l):
    k = l - i
    for j in range(i+1):
        a = t[j:k+j]
        if a in s:
            flag = True
            break
    if flag:
        break
if flag:
    print(i)
else:
    print(l)
# Judge status: Accepted
from math import factorial

def combinations_count(n, r):
  return factorial(n) // (factorial(n - r) * factorial(r))

n,p = map(int,input().split())
a = list(map(int,input().split()))

eve = 0
odd = 0

for i in range(n):
	if a[i]%2==0:
		eve += 1
	else:
		odd += 1
		
eve_cb = 2**eve
odd_cb1 = 0
odd_cb2 = 0

if p==1:
  for i in range(1,odd+1)[::2]:
	  odd_cb1 += combinations_count(odd,i)
else:
  for i in range(0,odd+1)[::2]:
	  odd_cb2 += combinations_count(odd,i)

print(eve_cb*(odd_cb1*p + odd_cb2*(1-p)))
# Judge status: Accepted
N = int(input())
As = list(map(int, input().split()))

As = {v:i+1 for i,v in enumerate(As)}
#print(As)

ans = [As[i] for i in range(1, N+1)]
print(*ans)
# Judge status: Wrong Answer
N,K=map(int,input().split())
H_list=list(map(int,input().split()))
H_list=sorted(H_list)
del H_list[-K:]
if len(H_list)==0:
  print('0')
else:
  print(sum(H_list))
# Judge status: Wrong Answer
a=int(input())
if a<10:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10**8) 
S = input()
T = ""

cand = ["dream", "dreamer", "erase", "eraser"]

def clean_string(s):
    if s == "" :
        print("YES")
        sys.exit()
    if not any([s.startswith(c) for c in cand]):
        return
    
    for c in cand:
        if s.startswith(c):
            s_next = s[len(c):]
            clean_string(s_next)

clean_string(S)
print("NO")
# Judge status: Wrong Answer
N = int(input())
if N % 2 == 0:
    print(0.5)
else:
    print(0.6)
# Judge status: Accepted
N,X,Y = list(map(int, input().split()))

ans = [0]*(N+1)

for i in range(1,N+1):
    for j in range(i+1,N+1):
        ans[min(j-i,abs(j-Y)+abs(i-X)+1)] += 1

for j in range(1,N):
    print(ans[j])
# Judge status: Wrong Answer
n,x,y=map(int,input().split())
x,y=x-1,y-1
d=[[0]*n for i in range(n)]
ans=[0]*(n+1)



for i in range(n):
    for j in range(i+1,n):
        a=abs(i-j)
        b=abs(i-x)+1+abs(y-j)
        c=abs(y-i)+1+abs(x-j)
        d[i][j]=min(a,b,c)
        ans[d[i][j]]+=1
for i in range(1,n+1):
    print(ans[i])
# Judge status: Wrong Answer
N = int(input())
l = []

for _ in range(N):
    s = str(input())
    l.append(s)

import collections
c = collections.Counter(l)
c = c.most_common()
c.sort()
most_count = c[0][1]
for i in range(len(c)):
    if c[i][1] == most_count:
        print(c[i][0])
# Judge status: Wrong Answer
W, H, x, y =  map(int,input().split())
print((H*W)/2, 1 if (x==W//2 and y==H//2) else 0)
# Judge status: Accepted
n, a, b = map(int, input().split())
if a == b:
    ans = 1
elif n >= 2:
    ans = max(0, (n - 2) * (b - a) + 1)
else:
    ans = 0
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())

flag=False

for i in range(a):
    tmp = b*i+c
    if tmp%a == 0:
        flag=True
        break

if flag:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
n=int(input())
A=list(map(int,input().split()))

ans,cnt,mini=[],0,float('inf')
for a in A:
  if abs(a)!=a: cnt+=1
  ans.append(abs(a))
  mini=min(mini,abs(a))
if cnt%2==0:
  print(sum(ans))
else:
  print(sum(ans)-mini)
# Judge status: Accepted
import math
A,B,H,M = map(int,input().split())
zi = 30*H + 0.5*M
hun = M*6
ans = (A**2 + B**2 - 2*A*B*math.cos(math.radians(abs(zi-hun))))**0.5
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
hs = list(map(int, input().split()))

results = list()

results.append(0)

for i in range(1, n):
    score = float('INF')
    for j in range(1, min(k+1, i + 1)):
        score = min(score, results[i-j] + abs(hs[i-j] - hs[i]))
    results.append(score)

print(results[n-1])
# Judge status: Accepted
import collections
N,M=map(int,input().split())    
H=list(map(int,input().split()))
ans=[1]*N
for _ in range(M):
    AB=list(map(int,input().split()))
    if H[AB[0]-1] < H[AB[1]-1]:
        ans[AB[0]-1]=0
    elif H[AB[0]-1] > H[AB[1]-1]:
        ans[AB[1]-1]=0
    else:
        ans[AB[0]-1]=0
        ans[AB[1]-1]=0
#c=collections.Counter(ans)
print(ans.count(1))
# Judge status: Accepted
N,A,B = map(int,input().split())
if abs(B-A)%2==0:
    print(abs(B-A)//2)
elif A<B:
    print(min(A-1,N-B)+1+(B-A-1)//2)
else:
    print(min(B-1,N-A)+1+(A-B-1)//2)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if (a+b)%2==0:
    print((a+b)/2)
else:
    print((a+b)//2+1)
# Judge status: Accepted
A, B = map(int, input().split())
# https://atcoder.jp/contests/abc090/tasks/abc090_b
# 全探索でよくね？


def is_cycle(x):
    x = str(x)
    return x == x[::-1]


ans = 0
for x in range(A, B + 1):
    ans += is_cycle(x)
print(ans)
# Judge status: Accepted
s="".join(sorted(list(input())))
t="".join(sorted(list(input()),reverse=True))

if [s,t]==sorted([s,t]) and s!=t:
  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
 
n = int(readline())
m = map(int,read().split())
xl = zip(m,m)
c = [(x-l,x+l) for x,l in xl]
  
from operator import itemgetter
c.sort()
c.sort(key=itemgetter(1))

ans = 1
chk = c[0][1]
for i,j in c:
  if i >= chk:
    ans +=1
    chk = j
    
print(ans)
# Judge status: Accepted
S, T = map(str, input().split())

print(T + S)
# Judge status: Wrong Answer
N = int(input())
A = sorted(list(map(int, input().split())))
ai = max(A)
ai_idx = A.index(ai)
half_maxA = ai // 2 + 1
for idx, a in enumerate(A):
    if ai_idx == idx:
        continue
    if idx == 0:
        aj = a
    else:
        if abs(a - half_maxA) < abs(aj - half_maxA):
            aj = a
print(ai, aj)
# Judge status: Accepted
n = input()
s = list(map(int, input().split()))
ans = 0

while all(a%2==0 for a in s):
  ans +=1
  s = [a/2 for a in s]

print(ans)
# Judge status: Wrong Answer
s = input()
print('2018/01'+s[8:11])
# Judge status: Wrong Answer
S = input()
A = [0]*(len(S)+1)

for i in range(len(S)):
    if S[i] == "<":
        A[i+1] = A[i]+1

for i in range(len(S)-1, 0, -1):
    if S[i] == ">":
        A[i] = max(A[i], A[i+1]+1)

print(sum(A))