Buggy python submission (verdict: Runtime Error):
n=int(input())
dic = dict()

a = 0
for i in range(n):
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
    if dic[s] > a:
        a = dic[s]
box= []
for i in dic:
    if dic[i] == a:
        box.append(i)

ans = sorted(box)
for in in range(len(ans)):
    print(ans)

Fixed submission:
n=int(input())
dic = dict()

a = 0
for i in range(n):
    s = str(input())
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
    if dic[s] > a:
        a = dic[s]
box= []
for i in dic:
    if dic[i] == a:
        box.append(i)

ans = sorted(box)
for i in range(len(ans)):
    print(ans[i])

Buggy python submission (verdict: Runtime Error):
import itertools
n=int(input())
s = []
for _ in range(n):
    s.append(input())
#print(s)
#s = list(itertools.chain.from_iterable(s))
#print(s)
s_u = list(set(s))
box = []
box.append([s_u[0],s.count(s_u[0])])
for i in range(1,len(s_u)):
    if max(box) < s.count(s_u[i]):
        box.remove(max(box))
        box.append([s_u[i],s.count(s_u[i])])
    elif max(box) == s.count(s_u[i]):
        box.append([s_u[i],s.count(s_u[i])])
            
ans_box = sorted(box)
for i in range(len(ans_box)):
    print(ans_box[i])

Fixed submission:
n=int(input())
dic = dict()

a = 0
for i in range(n):
    s = str(input())
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
    if dic[s] > a:
        a = dic[s]
box= []
for i in dic:
    if dic[i] == a:
        box.append(i)

ans = sorted(box)
for i in range(len(ans)):
    print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n=int(input())
s = []
for _ in range(n):
    s.append(input())
#print(s)
#s = list(itertools.chain.from_iterable(s))
#print(s)
s_u = list(set(s))
box = []
for i in range(len(s_u)):
    box.append([s_u[i],s.count(s_u[i])])

box = sorted(box,key=lambda x:x[1],reverse=True)

ans_box = []
#ans_box.append(box[0][0])
for j in range(len(box)):
    if box[j][1] == box[0][1]:
        ans_box.append(box[j][0])
        
    else:
        break
ans_box = sorted(ans_box)
for i in range(len(ans_box)):
    print(ans_box[i])

Fixed submission:
n=int(input())
dic = dict()

a = 0
for i in range(n):
    s = str(input())
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
    if dic[s] > a:
        a = dic[s]
box= []
for i in dic:
    if dic[i] == a:
        box.append(i)

ans = sorted(box)
for i in range(len(ans)):
    print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n=int(input())
s = []
for _ in range(n):
    s.append(input())
#print(s)
#s = list(itertools.chain.from_iterable(s))
#print(s)
s_u = list(set(s))
box = []
for i in range(len(s_u)):
    box.append([s_u[i],s.count(s_u[i])])
count=1
box = sorted(box,key=lambda x:x[1],reverse=True)
#print(box)
for i in range(len(s_u)-1):
    if len(box)==1:
      break
    elif box[i][1] == box[i+1][1]:
        count+=1
    elif box[i][1] > box[i+1][1]:
        break
box_p = [box[i] for i in range(count)]
#print(box_p)
ans_box = sorted(box_p)
for i in range(count):
    print(ans_box[i][0])

Fixed submission:
n=int(input())
dic = dict()

a = 0
for i in range(n):
    s = str(input())
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
    if dic[s] > a:
        a = dic[s]
box= []
for i in dic:
    if dic[i] == a:
        box.append(i)

ans = sorted(box)
for i in range(len(ans)):
    print(ans[i])