ZhenlongDai/ACPR huggingface dataset:
Problem: p03486
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


s = list(S())
t = list(S())

ns = ''.join(sorted(s))
nt = ''.join(sorted(t)[::-1])
print(ns, nt)
if ns < nt:
    print('Yes')
else:
    print('No')


Failing test case input:
yx
zcy

Expected output:
Yes


Actual output:
xy zyc
Yes


Fixed submission (verdict: Accepted):
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


s = list(S())
t = list(S())

ns = ''.join(sorted(s))
nt = ''.join(sorted(t)[::-1])
if ns < nt:
    print('Yes')
else:
    print('No')

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import random
s=list(input())
t=list(input())
random.shuffle(s)
random.shuffle(t)
S=''.join(s)
T=''.join(t)
L=[S,T]
L.sort()
if T==S:
  print('No')
elif L[0]==S:
  print('Yes')
else:
  print('No')


Failing test case input:
ratcode
atlas

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s=list(input())
t=list(input())
S=''.join(sorted(s))
T=''.join(sorted(t)[::-1])
L=sorted([S,T])

if S==T:
  print('No')
else:
  if L[0]==S:
    print('Yes')
  else:
    print('No')

Problem: p03486
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
t = input()

s_list = list(s)
t_list = list(t)

s_sorted = sorted(s_list)
t_sorted = sorted(t_list)

s_joined = ''.join(s_sorted) 
t_joined = ''.join(t_sorted) 

if s_joined > t_joined:
    print("Yes")
else:
    print("No")

Failing test case input:
dd
acc

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
t = input()

s_list = list(s)
t_list = list(t)

s_sorted = sorted(s_list)
t_sorted = sorted(t_list, reverse=True)

s_joined = ''.join(s_sorted) 
t_joined = ''.join(t_sorted) 

if s_joined < t_joined:
    print("Yes")
else:
    print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print('yes' if sorted(input()) < sorted(input(), reverse=True) else 'No')


Failing test case input:
v
sw

Expected output:
Yes


Actual output:
yes


Fixed submission (verdict: Accepted):
print('Yes' if sorted(input()) < sorted(input(), reverse=True) else 'No')
Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(input())
t = sorted(input())

if s[0] < t[-1]:
  print("Yes")
elif s[0] > t[-1]:
  print("No")
else:
  if "".join(s) in "".join(t):
    print("Yes")
  else:
    print("No")

Failing test case input:
zzz
zzz

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
s = sorted(input())
t = sorted(input())

if s[0] < t[-1]:
  print("Yes")
elif s[0] > t[-1]:
  print("No")
else:
  if s == t:
    print("No")
  elif "".join(s) in "".join(t):
    print("Yes")
  else:
    print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=list(input())
y=list(input())
x.sort();y.sort()
if x==y:
  print('No')
else:
  print('Yes')


Failing test case input:
dd
c`b

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
x=list(input())
y=list(input())
x.sort();y.sort(reverse=True)
''.join(x);''.join(y)

if x<y:
  print('Yes')
else:
  print('No')

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

sorted(s)
sorted(t)

t = t[::-1]

if s<t:
    print("Yes")
else:
    print("No")

Failing test case input:
sdtboae
atlas

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()

s = sorted(s)
t = sorted(t)

t = t[::-1]
if s<t:
    print("Yes")
else:
    print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S = str(input())
T = str(input())
S = "".join(sorted(S))
T = "".join(sorted(T))
S = S[::-1]
ST = sorted([S,T])
if (ST[0]==T and S!=T):
    print ("Yes")
else:
    print ("No")

Failing test case input:
cd
bac

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

S = str(input())
T = str(input())
S = "".join(sorted(S))
T = "".join(sorted(T))
T = T[::-1]
ST = sorted([S,T])

if (ST[0]==S and S!=T):
    print ("Yes")
else:
    print ("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()
sl = [char for char in s]
tl = [char for char in t]
sl.sort()
tl.reverse()
ss = ''.join(sl)
tr = ''.join(tl)
if tr > ss:
  print('Yes')
else:
  print('No')

Failing test case input:
xy
xya

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()
sl = [char for char in s]
tl = [char for char in t]
sl.sort()
tl.sort()
tl.reverse()
ss = ''.join(sl)
tr = ''.join(tl)
if tr > ss:
  print('Yes')
else:
  print('No')

Problem: p03486
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = str(sorted(input()))
t = str(sorted(input())[::-1])
print('Yes' if s < t else 'No')


Failing test case input:
w
uw

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = sorted(input())
t = sorted(input())[::-1]
print('Yes' if s < t else 'No')
Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(input(), reverse=False)
t = sorted(input(), reverse=True)

if s[-1] <= t[0] and not s[-1] == "z":
    print("Yes")
else:
    print("No")


Failing test case input:
zyy
x{|

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = sorted(input(), reverse=False)
t = sorted(input(), reverse=True)

if s < t:
    print("Yes")
else:
    print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

s = list(s)
s.sort()
s = "".join(s)

t = list(t)
t.sort()
t.reverse()
t = "".join(t)

l = [s, t]
if l == sorted(l):
    print("Yes")
else:
    print("No")

Failing test case input:
zzz
zzz

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
t = input()

s = list(s)
s.sort()
s = "".join(s)

t = list(t)
t.sort()
t.reverse()
t = "".join(t)

if s < t:
    print("Yes")
else:
    print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(input())
t = sorted(input())
print("Yes" if s < t else "No")


Failing test case input:
zzy
|xz

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = sorted(input())
t = sorted(input())[::-1]
print("Yes" if s < t else "No")

Problem: p03486
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

def Two_Anagrams(s , t):

    ans = ""
    s.sort()
    t.sort(reverse=True)

    for i in range(min(len(s) , len(t))):
        if s[i] > t[i]:
            ans = "No"
            break
        elif s[i] < t[i]:
            ans = "Yes"
            break
    
    if ans == "" and len(s) >= len(t):
        ans = "No"
    else:
        ans = "Yes"

    return ans

def main():
    s = list(str(input()))
    t = list(str(input()))
    print(Two_Anagrams(s , t))

if __name__ == '__main__':
    main()


Failing test case input:
dd
acc

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

def Two_Anagrams(s , t):

    ans = ""
    s.sort()
    t.sort(reverse=True)

    for i in range(min(len(s) , len(t))):
        if s[i] > t[i]:
            ans = "No"
            break
        elif s[i] < t[i]:
            ans = "Yes"
            break

    if not ans and len(s) >= len(t):
        ans = "No"
    elif not ans:
        ans = "Yes"

    return ans

def main():
    s = list(str(input()))
    t = list(str(input()))
    print(Two_Anagrams(s , t))

if __name__ == '__main__':
    main()

Problem: p03486
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
t = input()

sr = sorted(s)
tr = sorted(t,reverse = True)

print(sr)
print(tr)

if sr < tr:
    print('Yes')
else:
    print('No')

Failing test case input:
xx
axy

Expected output:
Yes


Actual output:
['x', 'x']
['y', 'x', 'a']
Yes


Fixed submission (verdict: Accepted):
s = input()
t = input()

sr = sorted(s)
tr = sorted(t,reverse = True)




if sr < tr:
    print('Yes')
else:
    print('No')
Problem: p03486
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
s = list(input())
t = list(input())

S = sorted(s)
T = sorted(t, reverse = True)

U = min(len(s), len(t))

for i in range(U):
    if S[i] < T[i]:
        print("Yes")
        break
    elif S[i] == T[i]:
        continue
    else:
        print("No")
        break
    
if len(S) < len(T):
    print("Yes")
else:
    print("No")

Failing test case input:
sctboae
atlat

Expected output:
Yes


Actual output:
Yes
No


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())

S = sorted(s)
T = sorted(t, reverse = True)


U = min(len(s), len(t))

for i in range(U):
    if S[i] < T[i]:
        print("Yes")
        exit()
    elif S[i] == T[i]:
        continue
    else:
        print("No")
        exit()
    
if len(S) < len(T):
    print("Yes")
else:
    print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(list(input()))
t = sorted(list(input()),reverse = True)

if str(s) < str(t):
  print("Yes")
else:
  print("No")

Failing test case input:
w
ww

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = sorted(input())
t = sorted(input(),reverse = True)

if "".join(s) < "".join(t):
  print("Yes")
else:
  print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())

s.sort()
t.sort()
t.reverse()

for S,T in zip(s,t):
	if 'S' == 'T':
		continue

	elif ord(S) < ord(T):
		print("Yes")
		exit(0)

	else :
		print("No") 
		exit(0)

if len(s) < len(t):
	print("Yes")

else:
	print("No")

Failing test case input:
v
vq

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())

s.sort()
t.sort()
t.reverse()

for S,T in zip(s,t):
	if 'S' == 'T':
		continue

	elif ord(S) < ord(T):
		print("Yes")
		exit(0)

	elif ord(T) < ord(S):
		print("No") 
		exit(0)

if len(s) < len(t):
	print("Yes")

else:
	print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(list(input()))
t = sorted(list(input()), reverse=True)

ss = ''.join(s)
tt = ''.join(t)

ans = sorted([tt,ss])
print(['No', 'Yes'][ans[0] == ss])

Failing test case input:
zzz
zzz

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
s = sorted(list(input()))
t = sorted(list(input()), reverse=True)

ss = ''.join(s)
tt = ''.join(t)

ans = sorted([tt,ss])

if ss == tt:
    print('No')
else:
    print(['No', 'Yes'][ans[0] == ss])

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())

s.sort()
t.sort(reverse=True)

if s[0] < t[0]:
    print("Yes")
elif s.count(s[0]) < t.count(t[0]):
    print("Yes")
else:
    print("No")

Failing test case input:
v
vq

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())

s.sort()
t.sort(reverse=True)
s = "".join(s)
t = "".join(t)

if s < t:
    print("Yes")
else:
    print("No")
Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(list(input()),reverse=True)
t = sorted(list(input()),reverse=True)
if str(s) < str(t):
  print("Yes")
else:
  print("No")

Failing test case input:
xy
xya

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = sorted(list(input()))
t = sorted(list(input()),reverse=True)
if s < t:
  print("Yes")
else:
  print("No")

Problem: p03486
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
t = input()

ss = "".join(sorted(s))
ts = "".join(sorted(t,reverse=True))

sortlist = sorted([ss,ts])

if sortlist[0] == ss:
  print("Yes")
else:
  print("No")

Failing test case input:
zzz
zzz

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
t = input()

ss = "".join(sorted(s))
ts = "".join(sorted(t,reverse=True))

if ss<ts:
  print("Yes")
else:
  print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t, reverse=True)
flag = False
same = True
for i in range(min(len(s), len(t))):
    if(s[i] < t[i]):
        flag = True
        break
    elif(s[i] < t[i]):
        same = False

if (flag):
    print("Yes")
else:
    if(same and len(s) < len(t)):
        print("Yes")
    else:
        print("No")

Failing test case input:
{
vv

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t, reverse=True)
flag = False
same = True
for i in range(min(len(s), len(t))):
    if(s[i] < t[i]):
        flag = True
        break
    elif(s[i] > t[i]):
        same = False

if (flag):
    print("Yes")
else:
    if(same and len(s) < len(t)):
        print("Yes")
    else:
        print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = sorted(input())
T = sorted(input(),reverse=True)
A = "No"
for sc,tc in zip(S,T):
    if sc == tc:
        continue
    elif sc < tc:
        A = "Yes"
        break
    else:
        break
if len(S) < len(T):
    A = "Yes"
print(A)

Failing test case input:
dd
bc`

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = sorted(input())
T = sorted(input(),reverse=True)
A = "No"
for sc,tc in zip(S,T):
    if sc == tc:
        continue
    elif sc < tc:
        A = "Yes"
        break
    else:
        break
if S == T[:len(S)] and len(S) < len(T):
    A = "Yes"
print(A)

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import random
s=list(input())
t=list(input())
random.shuffle(s)
random.shuffle(t)
S=''.join(s)
T=''.join(t)
L=[S,T]
L.sort()
if L[0]==S:
  print('Yes')
else:
  print('No')



Failing test case input:
xx
ayx

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s=list(input())
t=list(input())
S=''.join(sorted(s))
T=''.join(sorted(t)[::-1])
L=sorted([S,T])

if S==T:
  print('No')
else:
  if L[0]==S:
    print('Yes')
  else:
    print('No')
Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(input())
b = list(input())

a.sort()
b.sort(reverse=True)

a = "".join(a)
b = "".join(b)

print("Yes" if a <= b else "No")


Failing test case input:
zzz
zzz

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
a = list(input())
b = list(input())

a.sort()
b.sort(reverse=True)

a = "".join(a)
b = "".join(b)

print("Yes" if a < b else "No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = sorted(input())
b = reversed(input())
c = ''.join(a) 
d = ''.join(b)

if c < d:
  print("Yes")
elif c >= d:
    print("No")

Failing test case input:
zyz
{zx

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a = sorted(input())
b = reversed(sorted(input()))
c = ''.join(a) 
d = ''.join(b)

if c < d :
	print("Yes")
elif c >= d:
	print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
lists=[]
for i in range(len(s)):
    lists.append(s[i])
    
t=input()
listt=[]
for j in range(len(t)):
    listt.append(t[j])
    
lists.sort()
listt.sort(reverse=True)

list1=[lists,listt]
list1.sort()
if list1[0]==lists:
    print("Yes")
else:
    print("No")


Failing test case input:
zzz
zzz

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):


s=input()
lists=[]
for i in range(len(s)):
    lists.append(s[i])
    
t=input()
listt=[]
for j in range(len(t)):
    listt.append(t[j])
    
lists.sort()
listt.sort(reverse=True)

list1=[lists,listt]
list1.sort()
if lists==listt:
    print("No")
elif list1[0]==lists:
    print("Yes")
else:
    print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = input()
y = input()  

xnew = sorted(x)
xnew = ''.join(xnew)

ynew = sorted(y)
ynew = ''.join(ynew)

if xnew < ynew:
  print("Yes")
else:
  print("No")

Failing test case input:
yy
bzy

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
x = input()
y = input()  
 
xnew = sorted(x)
xnew = ''.join(xnew)
 
ynew = sorted(y)
ynew.reverse() 

ynew = ''.join(ynew)
 
if xnew < ynew:
  print("Yes")
else:
  print("No")
Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())
s.sort()
t.sort()
t.reverse()
for i in range(min(len(s),len(t))):
    if s[min(len(s),len(t))-1] == t[min(len(s),len(t))-1]:
        if len(s) < len(t):
            print("Yes")
        else:
            print("No")
        break
    if s[i] < t[i]:
        print("Yes")
        break
    elif s[i] == t[i]:
        continue
    else:
        print("No")
        break


Failing test case input:
zzz
{zz

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())
s.sort()
t.sort()
t.reverse()
for i in range(min(len(s),len(t))):
    if s[i] < t[i]:
        print("Yes")
        break
    elif s[i] == t[i]:
        if s[min(len(s),len(t))-1] == t[min(len(s),len(t))-1]:
            if len(s) < len(t):
                print("Yes")
                break
            else:
                print("No")
                break
        continue
    else:
        print("No")
        break

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ls=list(input())
lt=list(input())
ls.sort()
lt.sort(reverse=True)
s_sorted=''.join(ls)
t_sorted=''.join(lt)
before=[s_sorted,t_sorted]
after=[s_sorted,t_sorted]
after.sort()
if before==after:
  print('Yes')
else:
  print('No')


Failing test case input:
zzz
zzz

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
ls=list(input())
lt=list(input())
if ls!=lt:
  ls.sort()
  lt.sort(reverse=True)
  s_sorted=''.join(ls)
  t_sorted=''.join(lt)
  before=[s_sorted,t_sorted]
  after=[s_sorted,t_sorted]
  after.sort()
  if before==after:
    print('Yes')
  else:
    print('No')

else:
  print('No')

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    s = sorted(input())
    t = sorted(input())

    S = ','.join(s)
    T = ','.join(t)

    if S < T:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Failing test case input:
zzy
{xz

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def main():
    s = sorted(input())
    t = sorted(input())[::-1]

    S = ','.join(s)
    T = ','.join(t)

    if S < T:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
t=input()
s_=sorted(s)
t_=sorted(t,reverse=True)
A=[]
A.append(s_)
A.append(t_)
B=sorted(A)
if B[0]!=s_:
  print("No")
else:
  print("Yes")

Failing test case input:
zzz
zzz

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()
t=input()
s_=sorted(s)
t_=sorted(t,reverse=True)
A=[]
A.append(s_)
A.append(t_)
B=sorted(A)
if B[0]==s_ and B[0]!=B[1]:
  print("Yes")
else:
  print("No")
Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

if ''.join(sorted(s, reverse=True)) < ''.join(sorted(t, reverse=True)):
    print("Yes")
else:
    print("No")

Failing test case input:
eaobtds
salta

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()

if ''.join(sorted(s)) < ''.join(sorted(t, reverse=True)):
    print("Yes")
else:
    print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    t = input()

    for i in s:
        for j in t:
            if ord(i)< ord(j):
                print('Yes')
                return
    
    print('No')

solve()


Failing test case input:
v
vq

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    t = input()

    s = sorted(s)
    t = sorted(t)

    for i in s:
        for j in t:
            if ord(i)< ord(j):
                print('Yes')
                return


    if len(s)<len(t):
        ok = 1
        for i in s:
            if i not in t:
                ok = 0
        if ok:
            print('Yes')
            return


    print('No')

solve()

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

S = list(s)
S.sort()
T = list(t)
T.reverse()
s = "".join(S)
t = "".join(T)
L = [S, T]
L2 = [S, T]
L.sort()
if S == T:
    print("No")
else:
    if L == L2:
        print("Yes")
    else:
        print("No")

Failing test case input:
xy
xya

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()

S = sorted(list(s))
T = reversed(sorted(list(t)))
s = "".join(S)
t = "".join(T)
L = [s, t]
L2 = sorted(L)
if s == t:
    print("No")
else:
    if L == L2:
        print("Yes")
    else:
        print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())

s.sort()
t.reverse()

import sys

for i, j in zip(s, t):
    print(i, j)
    if j > i:
        print('Yes')
        sys.exit(0)

t_a = sorted(t)
if len(s) < len(t_a):
    for i, j in zip(s, t_a):
        if i != j:
            print('No')
            sys.exit(0)

    print('Yes')
else:
    print('No')


Failing test case input:
sctboae
talta

Expected output:
Yes


Actual output:
a a
b t
Yes


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())

s.sort()
t.sort()
t = t[::-1]

import sys

for i, j in zip(s, t):
    if j > i:
        print('Yes')
        sys.exit(0)

if len(s) < len(t):
    for i in s:
        if i not in t:
            print('No')
            sys.exit(0)

    print('Yes')
else:
    print('No')
Problem: p03486
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

s = input()
t = input()


s_L = list(s)
t_L = list(t)

s_L = sorted(s_L)
t_L = sorted(t_L,reverse=True)

tmp = ["".join(s_L),"".join(t_L)]

tmp = sorted(tmp)
if tmp[0] == "".join(s_L):
    print("Yes")
else:
    print("No")

Failing test case input:
zzz
zzz

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):

s = input()
t = input()


s_L = list(s)
t_L = list(t)

s_L = sorted(s_L)
t_L = sorted(t_L,reverse=True)

s_L = "".join(s_L)
t_L = "".join(t_L)


if s_L < t_L:
    print("Yes")
else:
    print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()
if sorted(s) < sorted(t):
  print('Yes')
else:
  print('No')

Failing test case input:
sctboae
talta

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()

if sorted(s) < sorted(t, reverse=True):
  print('Yes')
else:
  print('No')

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())

s.sort()
t.reverse()

if s<t :
    print('Yes')
elif s==t:
    print('No')
else:
    print('No')

Failing test case input:
xy
xza

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())

s.sort()
t.sort()
t.reverse()

if s<t :
    print('Yes')
else:
    print('No')

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(str(input()))
b = list(str(input()))
a.sort()
b.sort()
c = "".join(a)
d = "".join(b)
if c < d:
  print("Yes")
else:
  print("No")

Failing test case input:
v
rw

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a = list(str(input()))
b = list(str(input()))
a.sort()
b.sort(reverse=True)
c = "".join(a)
d = "".join(b)
if c < d:
  print("Yes")
else:
  print("No")

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
t = str(input())
s = sorted(s)
t = sorted(t)
if(''.join(s) < ''.join(t)):
    print('Yes')
else:
    print('No')

Failing test case input:
yyy
{{x

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = str(input())
t = str(input())
s = sorted(s)
t = sorted(t, reverse = True)
if(''.join(s) < ''.join(t)):
    print('Yes')
else:
    print('No')

Problem: p03486
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = input()

c = sorted(a)
d = sorted(b)

if c <= d:
  print("Yes")
else:
  print("No")

Failing test case input:
oaebucs
atlat

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a = input()
b = input()

c = ''.join(sorted(a))
d = ''.join(sorted(b, reverse=True))

if c < d:
  print("Yes")
else:
  print("No")
Problem: p03486
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = sorted(x for x in input())
t = sorted([x for x in input()], reverse=True)
print('Yes' if s <= t else 'No')

Failing test case input:
zzz
zzz

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
s = sorted(x for x in input())
t = sorted([x for x in input()], reverse=True)
print('Yes' if s < t else 'No')
Problem: p02773
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
S = []
for _ in range(N):
    S.append(input())

import sys
from collections import Counter

count_dict = Counter(S)
most_freq = count_dict.most_common(1)[0][1]

print(most_freq)

for word, freq in sorted(count_dict.items(), key=lambda x: -x[1]):
    if freq == most_freq:
        print(word)

Failing test case input:
8
buffalo
buffalo
buffalo
buffalo
olaffub
buffalo
buffalo
buffalo

Expected output:
buffalo


Actual output:
7
buffalo


Fixed submission (verdict: Accepted):
N = int(input())
S = []
for _ in range(N):
    S.append(input())

import sys
from collections import Counter

count_dict = Counter(S)
most_freq = count_dict.most_common(1)[0][1]

words = []

for word, freq in sorted(count_dict.items(), key=lambda x: -x[1]):
    if freq == most_freq:
        words.append(word)

for word in sorted(words):
    print(word)

Problem: p02773
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from collections import Counter 
num = input()
ins = list()
aa = list()
qc = 0
for abhsa in range(0, int(num)):
  ins.append(input())
cnt = Counter(ins)
nums = cnt.most_common()
res = nums[0][0]
values, counts = zip(*cnt.most_common())
aa.append(values[0])
for haha in counts:
  aqc = qc + 1
  if int(len(counts) - int("1")) >= aqc:
    if counts[qc] == counts[aqc]:
      aa.append(values[aqc])
      qc += 1
print("\n".join(aa))

Failing test case input:
7
bass
btas
ikdk
kicj
asta
kcik
khck

Expected output:
asta
bass
btas
ikdk
kcik
khck
kicj


Actual output:
bass
btas
ikdk
kicj
asta
kcik
khck


Fixed submission (verdict: Accepted):
from collections import Counter 
num = input()
ins = list()
aa = list()
qc = 0
for abhsa in range(0, int(num)):
  ins.append(input())
cnt = Counter(ins)
nums = cnt.most_common()
res = nums[0][0]
values, counts = zip(*cnt.most_common())
aa.append(values[0])
for haha in counts:
  aqc = qc + 1
  if int(len(counts) - int("1")) >= aqc:
    if counts[qc] == counts[aqc]:
      aa.append(values[aqc])
      qc += 1
    else:
      break
aca = sorted(aa)
print("\n".join(aca))

Problem: p02773
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
l=0
s=[]
for i in range(n):
    si=input()
    s.append(si)
    li=len(si)
    l=max(l,li)
ans=[]
for i in range(n):
    if len(s[i])==l:
        ans.append(s[i])

ans.sort()
for i in ans:
    print(i)

Failing test case input:
4
ihsu
tbou
michia
luk

Expected output:
ihsu
luk
michia
tbou


Actual output:
michia


Fixed submission (verdict: Accepted):
n=int(input())
s=dict()
for i in range(n):
    si=input()
    if si in s:
        s[si]+=1
    else:
        s[si]=0
l=max(s.values())
ans=[]
for i in s:
    if s[i]==l:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)
Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter


N = int(input())
S = []
s_append = S.append

for i in range(N):
    s = input()
    s_append(s)


s_counter = Counter(S)
max = max(s_counter.values())

printed_items = []
append = printed_items.append
max_s = [s[0] for s in s_counter.items() if s[1] == max]
for i in sorted([s for s in S if s in max_s]):
    print(i)

Failing test case input:
7
bass
bass
kick
kick
bass
kick
kick

Expected output:
kick

Actual output:
kick
kick
kick
kick


Fixed submission (verdict: Accepted):
from collections import Counter


N = int(input())
S = []
s_append = S.append

for i in range(N):
    s = input()
    s_append(s)


s_counter = Counter(S)
max = max(s_counter.values())

printed_items = []
append = printed_items.append
max_s = [s[0] for s in s_counter.items() if s[1] == max]
for i in sorted(max_s):
    print(i)

Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = [input() for i in range(N)]

import collections

c = collections.Counter(S)


mx = c[max(c)]



L = set()
for s in S:
    if c[s] == mx:
        L.add(s)

L = list(L)
L.sort()
for l in L:
    print(l)



Failing test case input:
8
buffalo
buffalo
buffalo
buffalo
olaffub
buffalo
buffalo
buffalo

Expected output:
buffalo


Actual output:
olaffub


Fixed submission (verdict: Accepted):
N = int(input())
S = [input() for i in range(N)]

import collections

c = collections.Counter(S)


mx = c.most_common()[0][1]


L = set()
for s in S:
    if c[s] == mx:
        L.add(s)

L = list(L)
L.sort()
for l in L:
    print(l)

Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections

if __name__ == "__main__":
    N = int(input())
    S = []
    for i in range(N):
        S.append(input())
    S_collect = collections.Counter(S)
    S_tp = []
    for word in S_collect.most_common():
        S_tp.append(word)
    for i  in S_tp:
        if i[1] == S_tp[0][1]:
            print(i[0])
        else:
            exit()


Failing test case input:
7
bt`s
btbs
ildk
kicj
btsa
kcjk
khck

Expected output:
bt`s
btbs
btsa
ildk
kcjk
khck
kicj


Actual output:
bt`s
btbs
ildk
kicj
btsa
kcjk
khck


Fixed submission (verdict: Accepted):
import collections

if __name__ == "__main__":
    N = int(input())
    S = []
    for i in range(N):
        S.append(input())
    S_collect = collections.Counter(S)
    S_tp = []
    for word in S_collect.most_common():
        S_tp.append(word)
    S_tp_sort = []
    for i in S_tp:
        if i[1] == S_tp[0][1]:
            S_tp_sort.append(i[0])
        else:
            break
    S_tp_sort = sorted(S_tp_sort)
    for s in S_tp_sort:
        print(s)
Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = [str(input()) for i in range(n)]
l.sort()
i = 0
count = 1
ans = []
max = 1
while i < n-1:
  if l[i] == l[i+1]:
    count += 1
    i += 1
    if count >= max:
      max = count
    if i == n-1:
      ans.append([l[n-1], count])

  else:
      ans.append([l[i],count])
      count = 1
      i += 1

for i in ans:
  if i[1] == max:
    print(i[0])





Failing test case input:
8
fubfalo
buefalo
buffamo
olaffub
ouafflb
omaffub
buffalo
buofalf

Expected output:
buefalo
buffalo
buffamo
buofalf
fubfalo
olaffub
omaffub
ouafflb


Actual output:
buefalo
buffalo
buffamo
buofalf
fubfalo
olaffub
omaffub


Fixed submission (verdict: Accepted):
n = int(input())
l = [str(input()) for i in range(n)]
l.sort()
i = 0
count = 1
ans = []
max = 1
while i < n-1:
  if l[i] == l[i+1]:
    count += 1
    i += 1
    if count >= max:
      max = count
    if i == n-1:
      ans.append([l[n-1], count])

  else:
      ans.append([l[i],count])
      count = 1
      i += 1

if max == 1:
  ans.append([l[n-1], 1])
      
for i in ans:
  if i[1] == max:
    print(i[0])

Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = [input() for i in range(N)]
S.sort()
maxi = 0
tmp = 0
ans = []
for i in range(N-1):
  if S[i] == S[i+1]:
    tmp += 1
  else:
    if tmp > maxi:
      maxi = tmp
      ans.clear()
      ans.append(S[i])
    elif tmp == maxi:
      ans.append(S[i])
    tmp = 0
  if i == N-2:
      if S[i] == S[i+1]:
        if tmp > maxi:
          maxi = tmp
          ans.clear()
          ans.append(S[i])
        elif tmp == maxi:
          ans.append(S[i])
      else:
        if maxi == 1:
          ans.append(S[N-1])
for i in range(len(ans)):
  print(ans[i])

Failing test case input:
4
igst
uobt
aimhic
kul

Expected output:
aimhic
igst
kul
uobt


Actual output:
aimhic
igst
kul


Fixed submission (verdict: Accepted):
N = int(input())
S = [input() for i in range(N)]
S.sort()
maxi = 0
tmp = 1
ans = []
for i in range(N-1):
  if S[i] == S[i+1]:
    tmp += 1
  else:
    if tmp > maxi:
      maxi = tmp
      ans.clear()
      ans.append(S[i])
    elif tmp == maxi:
      ans.append(S[i])
    tmp = 1
  if i == N-2:
      if S[i] == S[i+1]:
        if tmp > maxi:
          maxi = tmp
          ans.clear()
          ans.append(S[i])
        elif tmp == maxi:
          ans.append(S[i])
      else:
        if maxi == 1:
          ans.append(S[N-1])
for i in range(len(ans)):
  print(ans[i])

Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = []
for i in range(N):
  S.append(str(input()))
m = max(S.count(S[i]), i in range(N))
S_new = set(S)
for s in S_new:
  if m == S.count(s):
    print(s)

Failing test case input:
7
afau
udv
bfet
dgb
tev
etc
teeb

Expected output:
afau
bfet
dgb
etc
teeb
tev
udv


Actual output:
etc
tev
dgb
udv
bfet
teeb
afau


Fixed submission (verdict: Accepted):
import collections
N = int(input())
S = []
for i in range(N):
  S.append(str(input()))
A = collections.Counter(S)
m = max(A.values())
for s in sorted(set(S)):
  if A[s] == m:
    print(s)
Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

dic = {}
for i in range(N):
    if i not in dic:
        dic[i] = 1
    else:
        dic[i] = dic[i]+1

l = dic.items()
max = 0
for i in l:
    if i[1] > max:
        max = i[1]

result = []
for i in l:
    if i[1] == max:
        result.append(i[0])

result.sort()

for i in result:
    print(i)

Failing test case input:
8
fufbblo
alofeub
omafftb
olaffvb
ouafflb
omaefub
buffalo
buofamf

Expected output:
alofeub
buffalo
buofamf
fufbblo
olaffvb
omaefub
omafftb
ouafflb


Actual output:
0
1
2
3
4
5
6
7


Fixed submission (verdict: Accepted):
N = int(input())


inin = []
for i in range(N):
    inin.append(str(input()))
    
dic = {}
for i in inin:
    if i not in dic:
        dic[i] = 1
    else:
        dic[i] = dic[i]+1

l = dic.items()
max = 0
for i in l:
    if i[1] > max:
        max = i[1]

result = []
for i in l:
    if i[1] == max:
        result.append(i[0])

result.sort()

for i in result:
    print(i)

Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
Clist = Counter(S).most_common()
num = Clist[0][1]
anses = [Clist[0][0]]
for X in Clist[1:]:
    if X[1] == num:
        anses.append(X[0])

for ans in anses:
    print(ans)

Failing test case input:
7
bt`s
btbs
dlik
kicj
btsa
kcjk
khck

Expected output:
bt`s
btbs
btsa
dlik
kcjk
khck
kicj


Actual output:
bt`s
btbs
dlik
kicj
btsa
kcjk
khck


Fixed submission (verdict: Accepted):
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
Clist = Counter(S).most_common()
num = Clist[0][1]
anses = [Clist[0][0]]
for X in Clist[1:]:
    if X[1] == num:
        anses.append(X[0])
anses.sort()
for ans in anses:
    print(ans)

Problem: p02773
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections
N = int(input())
S = {}
for i in range(N):
    value = input()
    if value not in S:
        S[value] = 1
    else:
        S[value] += 1
S_largest = max(S.values())
S_sorted = sorted(S.items(),reverse=True)
ans = []
for i in range(len(S_sorted)):
    if S_sorted[i][1] == S_largest:
        ans.append(S_sorted[i][0])
    else:
        break
ans_sorted = sorted(ans)
for a in ans_sorted:
    print(a)


Failing test case input:
7
beat
veu
beet
bed
vet
bet
beet

Expected output:
beet


Actual output:

Fixed submission (verdict: Accepted):
import collections
N = int(input())
S = {}
for i in range(N):
    value = input()
    if value not in S:
        S[value] = 1
    else:
        S[value] += 1
S_largest = max(S.values())
S_sorted = sorted(S.items(), key=lambda x:x[1], reverse=True)
ans = []
for i in range(len(S_sorted)):
    if S_sorted[i][1] == S_largest:
        ans.append(S_sorted[i][0])
    else:
        break
ans_sorted = sorted(ans)
for a in ans_sorted:
    print(a)
Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections

N = int(input())
S = []
kaisuu = []
solution = []
index = 0

for i in range(N):
  tmp = input()
  S.append(tmp)
  
c = collections.Counter(S)

d = c.most_common()

max_ = d[0][1]

for i in range(len(d)):
  if d[i][1] == max_:
    solution.append(d[i][0])

for i in solution:
  print(i)

Failing test case input:
8
fufbalo
buefola
buffamo
olaffvb
ouafflb
omaffub
buffalo
buofalf

Expected output:
buefola
buffalo
buffamo
buofalf
fufbalo
olaffvb
omaffub
ouafflb


Actual output:
fufbalo
buefola
buffamo
olaffvb
ouafflb
omaffub
buffalo
buofalf


Fixed submission (verdict: Accepted):
import collections

N = int(input())
solution = []
S = []

for i in range(N):
  tmp = input()
  S.append(tmp)
  
c = collections.Counter(S)

d = c.most_common()

max_ = d[0][1]

for i,k in enumerate(d):
  if d[i][1] == max_:
    solution.append(d[i][0])
    
solution.sort()

for i in solution:
  print(i)

Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

n = int(input())
a = [s for s in input().split()]

c = Counter(a)
list = c.most_common()
max = list[0][1]

ans = []
for i, j in list:
    if j == max:
        ans.append(i)
    else:
        break

ans.sort()
for i in range(len(ans)):
    print(ans[i])

Failing test case input:
7
afau
vdu
bfet
bgd
tew
etd
beet

Expected output:
afau
beet
bfet
bgd
etd
tew
vdu


Actual output:
afau


Fixed submission (verdict: Accepted):
from collections import Counter

n = int(input())
a = [input() for s in range(n)]

c = Counter(a)
list = c.most_common()
max = list[0][1]

ans = []
for i, j in list:
    if j == max:
        ans.append(i)
    else:
        break

ans.sort()
for i in range(len(ans)):
    print(ans[i])

Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
N = int(input())
List=[input() for i in range(N)]

c = collections.Counter(List)
c_sorted = sorted(c.items(), key=lambda x:x[1],reverse=True)

maxCount = c_sorted[0][1]
keys = [k for k, v in c.items() if v ==maxCount]
for s in keys:
    print(s)

Failing test case input:
7
afau
tdv
bfet
bdg
tew
ete
beet

Expected output:
afau
bdg
beet
bfet
ete
tdv
tew


Actual output:
afau
tdv
bfet
bdg
tew
ete
beet


Fixed submission (verdict: Accepted):
import collections
N = int(input())
List=[input() for i in range(N)]
 
c = collections.Counter(List)
c_sorted = sorted(c.items(), key=lambda x:x[1],reverse=True)
 
maxCount = c_sorted[0][1]
keys = [k for k, v in c.items() if v ==maxCount]
keys.sort()
for s in keys:
    print(s)
Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
import collections

n = int(input())
s = [input() for i in range(n)]

counted = collections.Counter(s)

m = max(counted.values())

chars = [key for key, value in counted.items()
             if value == m]
moji = '\n'.join(chars)

print(moji)

Failing test case input:
8
fuebblo
alofeub
omafftb
palffvb
ouafflb
omaefub
bl`ffuo
buofanf

Expected output:
alofeub
bl`ffuo
buofanf
fuebblo
omaefub
omafftb
ouafflb
palffvb


Actual output:
fuebblo
alofeub
omafftb
palffvb
ouafflb
omaefub
bl`ffuo
buofanf


Fixed submission (verdict: Accepted):
import collections

n = int(input())
s = [input() for i in range(n)]

counted = collections.Counter(s)

m = max(counted.values())

chars = [key for key, value in counted.items()
             if value == m]
chars.sort()

moji = '\n'.join(chars)

print(moji)

Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
d = {}
for i in range(n):
	s = input()
	if s in d:
		d[s] += 1
	else:
		d[s] = 1
l = list(d.items())
l = sorted(l, key=lambda x:x[1])
nn = len(l)
m = l[nn-1][1]
i = nn - 1
while l[i][1] == m:
	print(l[i][0])
	i -= 1
	if i == -1:
		break


Failing test case input:
4
jsgs
uobt
ahmiic
muk

Expected output:
ahmiic
jsgs
muk
uobt


Actual output:
muk
ahmiic
uobt
jsgs


Fixed submission (verdict: Accepted):
n = int(input())
d = {}
for i in range(n):
	s = input()
	if s in d:
		d[s] += 1
	else:
		d[s] = 1
l = list(d.items())
l = sorted(l, key=lambda x:x[1])
nn = len(l)
m = l[nn-1][1]
i = nn - 1
ll = []
while l[i][1] == m:
	ll.append(l[i][0])
	i -= 1
	if i == -1:
		break
ll.sort()
for i in range(len(ll)):
	print(ll[i])

Problem: p02773
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

d = {}
for _ in range(N):
  s = input()
  if s in d:
    d[s] += 1
  else:
    d[s] = 1
    
d = {k: v for k, v in sorted(d.items(), key=lambda item: item[1], reverse=True)}

max_count = -1
for k, v in d.items():
  if max_count < v:
    max_count = v
  if v != max_count:
    break
  print(k)

Failing test case input:
4
sgsj
uobt
ahmhic
muk

Expected output:
ahmhic
muk
sgsj
uobt


Actual output:
sgsj
uobt
ahmhic
muk


Fixed submission (verdict: Accepted):
N = int(input())

d = {}
for _ in range(N):
  s = input()
  if s in d:
    d[s] += 1
  else:
    d[s] = 1
    
d = {k: v for k, v in sorted(d.items(), key=lambda item: item[1], reverse=True)}

max_count = -1
values = []
for k, v in d.items():
  if max_count < v:
    max_count = v
  if v != max_count:
    break
  values.append(k)

print("\n".join(sorted(values)))
Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
s=[input() for i in range (N)]

s.sort()
count=1
maximum=0

for j in range (N-1):
  if s[j]==s[j+1]:
    count+=1
    if j==N-2:
      if count>maximum:
        a=[]
        a.clear()
        a.append(s[j])
        maximum=count
        number=1
      elif count==maximum:
        a.append(s[j])
        number+=1
  else:
    if count>maximum:
      a=[]
      a.clear()
      a.append(s[j])
      maximum=count
      number=1
    elif count==maximum:
      a.append(s[j])
      number+=1
    count=1   
  if maximum==1 and j==N-2:
    a.append(s[j])
    number+=1
for p in range (number):
  print(a[p])

Failing test case input:
7
beat
veu
bfet
bed
vte
cet
teeb

Expected output:
beat
bed
bfet
cet
teeb
veu
vte


Actual output:
beat
bed
bfet
cet
teeb
veu
veu


Fixed submission (verdict: Accepted):
N=int(input())
s=[input() for i in range (N)]

s.sort()
count=1
maximum=0

for j in range (N-1):
  if s[j]==s[j+1]:
    count+=1
    if j==N-2:
      if count>maximum:
        a=[]
        a.clear()
        a.append(s[j])
        maximum=count
        number=1
      elif count==maximum:
        a.append(s[j])
        number+=1
  else:
    if count>maximum:
      a=[]
      a.clear()
      a.append(s[j])
      maximum=count
      number=1
    elif count==maximum:
      a.append(s[j])
      number+=1
    count=1   
  if maximum==1 and j==N-2:
    a.append(s[N-1])
    number+=1
for p in range (number):
  print(a[p])

Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
n = int(input())
S = []
for _ in range(n):
    s = input()
    S.append(s)
cnt = Counter(S)
l = max(cnt.values())

ans = []
for k,v in cnt.items():
  if v == l:
    ans.append(k)
print(ans)
ans.sort()
for i in ans:
  print(i)

Failing test case input:
8
fuebblo
alofeub
omafftb
palffvb
ouafflb
omaefub
bl`ffuo
buofanf

Expected output:
alofeub
bl`ffuo
buofanf
fuebblo
omaefub
omafftb
ouafflb
palffvb


Actual output:
['fuebblo', 'alofeub', 'omafftb', 'palffvb', 'ouafflb', 'omaefub', 'bl`ffuo', 'buofanf']
alofeub
bl`ffuo
buofanf
fuebblo
omaefub
omafftb
ouafflb
palffvb


Fixed submission (verdict: Accepted):
from collections import Counter
n = int(input())
S = []
for _ in range(n):
    s = input()
    S.append(s)
cnt = Counter(S)
l = max(cnt.values())

ans = []
for k,v in cnt.items():
  if v == l:
    ans.append(k)

ans.sort()
for i in ans:
  print(i)

Problem: p02773
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
l=[]
import collections
for _ in range(n):
  l.append(str(input()))
c = collections.Counter(l)
m=max(c.items())[1]
x=[]
for i in c:
  if c[i]==m:
    x.append(i)
xy=sorted(x)
for i in xy:
  print(i)

Failing test case input:
8
buffalo
buffalo
buffalo
buffalo
olaffub
buffalo
buffalo
buffalo

Expected output:
buffalo


Actual output:
olaffub


Fixed submission (verdict: Accepted):
n=int(input())
l=[]
import collections
for _ in range(n):
  l.append(str(input()))
c = collections.Counter(l)
m=max(c.values())
x=[]
for i in sorted(c):
  if c[i]==m:
    print(i)
Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

strs = []
dicts = {}
for i in range(N):
    s = input()
    if dicts.get(s) is not None:
        dicts[s] += 1
    else:
        dicts[s] = 1

dict_sorted = sorted(dicts.items(), key=lambda x:x[1], reverse=True)

i = 0
sts = []
for s in dict_sorted:
    if dicts[s[0]] >= i:
        sts.append(s[0])
    i = dicts[s[0]]

for s in sorted(sts):
    print(s)

Failing test case input:
7
beat
veu
beet
bed
vet
bet
beet

Expected output:
beet


Actual output:
bed
beet
bet
vet
veu


Fixed submission (verdict: Accepted):
N = int(input())

strs = []
dicts = {}
for i in range(N):
    s = input()
    if dicts.get(s) is not None:
        dicts[s] += 1
    else:
        dicts[s] = 1

dict_sorted = sorted(dicts.items(), key=lambda x:x[1], reverse=True)

i = 0
sts = []
for s in dict_sorted:
    if dicts[s[0]] == dicts[dict_sorted[0][0]]:
        sts.append(s[0])
    i = dicts[s[0]]

for s in sorted(sts):
    print(s)

Problem: p02773
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

N = int(input())
ss = []
for i in range(N):
  ss.append(input())

c = Counter(ss)

print(c)
max_count = max(c.values())
for k, v in c.items():
  if v == max_count:
    print(k)

Failing test case input:
4
tgsj
uobt
ahmhic
kum

Expected output:
ahmhic
kum
tgsj
uobt


Actual output:
Counter({'tgsj': 1, 'uobt': 1, 'ahmhic': 1, 'kum': 1})
tgsj
uobt
ahmhic
kum


Fixed submission (verdict: Accepted):
from collections import Counter

N = int(input())
ss = []
for i in range(N):
  ss.append(input())

c = Counter(ss)

max_count = max(c.values())

out_k = []
for k, v in c.items():
  if v == max_count:
    out_k.append(k)
out_k.sort()
for k in out_k:
  print(k)