Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    n=int(input())
    count=0
    scount=0
    listcount=0
    anslist=[]
    s=[]
    for i in range(n):
        a=input()
        s.append(a)
    s_count=s.count
    s.sort()
    for i in range(n):
        if listcount==n:
            break
        scount=s_count(s[listcount])
        if scount>count:
            count=scount
            anslist.clear()
            anslist.append(s[listcount])
        elif scount==count:
            anslist.append(s[listcount])
        listcount+=scount
    anslist.sort()
    for i in range(len(anslist)):
        print(anslist[i])
solve()


Fixed submission:
from collections import Counter
n=int(input())
list=[input() for _ in range(n)]
list.sort()
c=Counter(list).most_common()
most=c[0][1]
c.sort()
for i in range(len(c)):
    if c[i][1]==most:
        print(c[i][0])

Buggy python submission (verdict: Runtime Error):
n=int(input())
count=0
scount=0
listcount=0
anslist=[]
s=[]
for i in range(n):
    a=input()
    s.append(a)
s_count=s.count
s.sort()
for i in range(n):
    if listcount==n:
        break
    scount=s_count(s[listcount])
    if scount>count:
        count=scount
        anslist.clear()
        anslist.append(s[listcount])
    elif scount==count:
        anslist.append(s[listcount])
    listcount+=scount
anslist.sort()
for i in range(len(anslist)):
    print(anslist[i])


Fixed submission:
from collections import Counter
n=int(input())
list=[input() for _ in range(n)]
list.sort()
c=Counter(list).most_common()
most=c[0][1]
c.sort()
for i in range(len(c)):
    if c[i][1]==most:
        print(c[i][0])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
count=0
scount=0
listcount=0
anslist=[]
s=[]
for i in range(n):
    a=input()
    s.append(a)
s_count=s.count
s.sort()
for i in range(n):
    if listcount==n:
        break
    scount=s_count(s[listcount])
    if scount>count:
        count=scount
        anslist.clear()
        anslist.append(s[listcount])
    elif scount==count:
        anslist.append(s[listcount])
    listcount+=scount
anslist.sort()
for i in range(len(anslist)):
    print(anslist[i])


Fixed submission:
from collections import Counter
n=int(input())
list=[input() for _ in range(n)]
list.sort()
c=Counter(list).most_common()
most=c[0][1]
c.sort()
for i in range(len(c)):
    if c[i][1]==most:
        print(c[i][0])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
b=0
c=0
d=0
e=0
list=[]
list2=[]
for i in range(n):
    s=input()
    list.append(s)
for x in list:
    b=list.count(x)
    if b>=c:
        c=b
for x in list:
    if c==list.count(x):
        list2.append(x)
e=len(list2)
for i in range(e):
    if list2.count(list2[d])>=2:
        list2.remove(list2[d])
    else:
        d+=1
list2.sort()
for x in list2:
    print(x)


Fixed submission:
from collections import Counter
n=int(input())
list=[input() for _ in range(n)]
list.sort()
c=Counter(list).most_common()
most=c[0][1]
c.sort()
for i in range(len(c)):
    if c[i][1]==most:
        print(c[i][0])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
b=0
c=0
d=0
e=0
list=[]
list2=[]
for i in range(n):
    s=input()
    list.append(s)
for x in list:
    b=list.count(x)
    if b>=c:
        c=b
for x in list:
    if c==list.count(x):
        list2.append(x)
e=len(list2)
for i in range(e):
    if list2.count(list2[d])>=2:
        list2.remove(list2[d])
    else:
        d+=1
list2.sort()
for x in list2:
    print(x)


Fixed submission:
from collections import Counter
n=int(input())
list=[input() for _ in range(n)]
list.sort()
c=Counter(list).most_common()
most=c[0][1]
c.sort()
for i in range(len(c)):
    if c[i][1]==most:
        print(c[i][0])