Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
wordlist = [input() for i in range(n)]
wordtuple = tuple(set(wordlist))
checklist = []
ans = []
a = len(wordtuple)
for j in range(a) :
    checklist.append(wordlist.count(wordtuple[j]))
maxnum = max(checklist)
anslist = [i for i, v in enumerate(checklist) if v == maxnum]
for k in anslist :
    ans.append(wordtuple[k])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

Fixed submission:
n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
wordlist = [input() for i in range(n)]
wordtuple = tuple(set(wordlist))
checklist = []
ans = []
a = len(wordtuple)
for j in range(a) :
    checklist.append(wordlist.count(wordtuple[j]))
anslist = [i for i, v in enumerate(checklist) if v == max(checklist)]
for k in anslist :
    ans.append(wordtuple[k])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

Fixed submission:
n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Runtime Error):
n = int(input())
wordlist = [input() for i in range(n)]
wordtuple = tuple(set(wordlist))
ans = []
a = len(wordtuple)
for j in range(a) :
    checklist.append(wordlist.count(wordtuple[j]))
anslist = [i for i, v in enumerate(checklist) if v == max(checklist)]
for k in anslist :
    ans.append(wordtuple[k])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

Fixed submission:
n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Runtime Error):
n = int(input())
wordlist = [input() for i in range(n)]
wordtuple = tuple(set(wordlist))
ans = []
a = len(wordtuple)
for j in range(a) :
    checklist.append(wordlist.count(wordtuple[j]))
anslist = [i for i, v in enumerate(checklist) if v == max(checklist)]
for k in range(len(anslist)) :
    ans.append(wordtuple[k])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

Fixed submission:
n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
wordlist = [input() for i in range(n)]
wordtuple = tuple(set(wordlist))
ans = []
maxnum = 0
a = len(wordtuple)
for j in range(a) :
    countnum = wordlist.count(wordtuple[j])
    if countnum == maxnum :
        ans.append(wordtuple[j])
    if countnum > maxnum :
        maxnum = countnum
        ans = []
        ans.append(wordtuple[j])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

Fixed submission:
n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
wordlist = [input() for i in range(n)]
wordlist2 = list(set(wordlist))
ans = []
maxnum = 0
for j in range(len(wordlist2)) :
    countnum = wordlist.count(wordlist2[j])
    if countnum == maxnum :
        ans.append(wordlist2[j])
    if countnum > maxnum :
        maxnum = countnum
        ans = []
        ans.append(wordlist2[j])
    while wordlist2[j] in wordlist :
        wordlist.remove(wordlist2[j])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

Fixed submission:
n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
wordlist = [input() for i in range(n)]
wordlist2 = list(set(wordlist))
ans = []
maxnum = 0
for j in range(len(wordlist2)) :
    countnum = wordlist.count(wordlist2[j])
    if countnum == maxnum :
        ans.append(wordlist2[j])
    if countnum > maxnum :
        maxnum = countnum
        ans = []
        ans.append(wordlist2[j])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

Fixed submission:
n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
wordlist = [input() for i in range(n)]
wordset = set(wordlist)
wordlist2 = list(wordset)
checklist = []
ans = []
for j in range(len(wordlist2)) :
    checklist.append(wordlist.count(wordlist2[j]))
position = [i for i, x in enumerate(checklist) if x == max(checklist)]
for k in position :
    ans.append(wordlist2[k])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

Fixed submission:
n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)