Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
word = [input() for i in range(n)]
test = list([x,word.count(x)] for x in set(word))
max_num = int(max(test, key=lambda x: x[1])[1])
if(max_num == 1):
  print('\n'.join(sorted(word)))
else:
  print('\n'.join(sorted([num[0] for num in test if int(num[1]) == max_num])))


Fixed submission:
from collections import Counter
n = int(input())
word = Counter([input() for i in range(n)]).most_common()
print('\n'.join(sorted([num[0] for num in word if int(num[1]) == word[0][1]])))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
word = [input() for i in range(n)]
test = list([x,word.count(x)] for x in set(word))
max_num = int(max(test, key=lambda x: x[1])[1])
print('\n'.join(sorted([num[0] for num in test if int(num[1]) == max_num])))


Fixed submission:
from collections import Counter
n = int(input())
word = Counter([input() for i in range(n)]).most_common()
print('\n'.join(sorted([num[0] for num in word if int(num[1]) == word[0][1]])))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
word = [input() for i in range(n)]
test = list([x,word.count(x)] for x in set(word))
max_num = int(max(test, key=lambda x: x[1])[1])

print('\n'.join(sorted([num[0] for num in test if int(num[1]) == max_num])))


Fixed submission:
from collections import Counter
n = int(input())
word = Counter([input() for i in range(n)]).most_common()
print('\n'.join(sorted([num[0] for num in word if int(num[1]) == word[0][1]])))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
word = [input() for i in range(n)]
test = list([x,0] for x in set(word))
max_num = 0

for i, num in enumerate(test):
  test[i][1] = word.count(num[0])
  if(test[i][1] >= max_num):
    max_num = test[i][1]

print('\n'.join(sorted([num[0] for num in test if int(num[1]) == max_num])))


Fixed submission:
from collections import Counter
n = int(input())
word = Counter([input() for i in range(n)]).most_common()
print('\n'.join(sorted([num[0] for num in word if int(num[1]) == word[0][1]])))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
word = [input() for i in range(n)]
test = list([x,0] for x in set(word))

for i, num in enumerate(test):
  test[i][1] = word.count(num[0])

num_max = int(max(test, key=lambda x: x[1])[1])

print('\n'.join(sorted([num[0] for num in test if int(num[1]) == num_max])))


Fixed submission:
from collections import Counter
n = int(input())
word = Counter([input() for i in range(n)]).most_common()
print('\n'.join(sorted([num[0] for num in word if int(num[1]) == word[0][1]])))

Buggy python submission (verdict: Runtime Error):
n = int(input())
word = [input() for i in range(n)]
test = list([x,0] for x in set(word))

for i, num in enumerate(test):
  test[i][1] = word.count(num[0])

num_max = int(max(test, key=lambda x: x[1])[1])

print('\n'.join(sorted([num[0] for num in test if(int(num[1] == num_max)))))


Fixed submission:
from collections import Counter
n = int(input())
word = Counter([input() for i in range(n)]).most_common()
print('\n'.join(sorted([num[0] for num in word if int(num[1]) == word[0][1]])))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
word = [input() for i in range(n)]
test = list([x,0] for x in set(word))
sen = []

for i, num in enumerate(test):
  test[i][1] = word.count(num[0])

num_max = int(max(test, key=lambda x: x[1])[1])

for i, num in enumerate(test):
  if(int(num[1]) == num_max):
    sen.append(num[0])

print('\n'.join(sorted(sen)))


Fixed submission:
from collections import Counter
n = int(input())
word = Counter([input() for i in range(n)]).most_common()
print('\n'.join(sorted([num[0] for num in word if int(num[1]) == word[0][1]])))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
word = [input() for i in range(n)]
test = list([x,0] for x in set(word))
sen = []

for i, num in enumerate(test):
  test[i][1] = word.count(num[0])

for i, num in enumerate(test):
  if(int(num[1]) == int(max(test, key=lambda x: x[1])[1])):
    sen.append(num[0])

print('\n'.join(sorted(sen)))


Fixed submission:
from collections import Counter
n = int(input())
word = Counter([input() for i in range(n)]).most_common()
print('\n'.join(sorted([num[0] for num in word if int(num[1]) == word[0][1]])))