Buggy python submission (verdict: Time Limit Exceeded):
def main():

    import sys
    from collections import defaultdict
    d = defaultdict(int)
    input = sys.stdin.readline

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

    for i in polls:
        d[i] += 1

    max_k_list = sorted([kv[0] for kv in d.items() if kv[1] == max(d.values())])

    for ans in max_k_list:
        print(ans)

if __name__ == '__main__':
    main()

Fixed submission:
import collections

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

c = collections.Counter(polls)
maxval = c.most_common()[0][1]

values, counts = zip(*c.most_common())

ans = []

for i in c.most_common():
    if i[1] == maxval:
        ans.append(i[0])
    else:
        break

ans.sort()

for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import defaultdict
d = defaultdict(int)
input = sys.stdin.readline


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

for i in polls:
    d[i] += 1

max_k_list = sorted([kv[0] for kv in d.items() if kv[1] == max(d.values())])
# max_k_list.sort()

for ans in max_k_list:
    print(ans)


Fixed submission:
import collections

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

c = collections.Counter(polls)
maxval = c.most_common()[0][1]

values, counts = zip(*c.most_common())

ans = []

for i in c.most_common():
    if i[1] == maxval:
        ans.append(i[0])
    else:
        break

ans.sort()

for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
d = defaultdict(int)


def main():
    n = int(input())
    polls = [input() for i in range(n)]

    for i in polls:
        d[i] += 1

    max_k_list = sorted([kv[0] for kv in d.items() if kv[1] == max(d.values())])
    # max_k_list.sort()

    for ans in max_k_list:
        print(ans)

if __name__ == '__main__':
    main()

Fixed submission:
import collections

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

c = collections.Counter(polls)
maxval = c.most_common()[0][1]

values, counts = zip(*c.most_common())

ans = []

for i in c.most_common():
    if i[1] == maxval:
        ans.append(i[0])
    else:
        break

ans.sort()

for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
d = defaultdict(int)


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

for i in polls:
    d[i] += 1

max_k_list = sorted([kv[0] for kv in d.items() if kv[1] == max(d.values())])
# max_k_list.sort()

for ans in max_k_list:
    print(ans)

Fixed submission:
import collections

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

c = collections.Counter(polls)
maxval = c.most_common()[0][1]

values, counts = zip(*c.most_common())

ans = []

for i in c.most_common():
    if i[1] == maxval:
        ans.append(i[0])
    else:
        break

ans.sort()

for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
d = defaultdict(int)


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

for i in polls:
    d[i] += 1

max_k_list = sorted([kv[0] for kv in d.items() if kv[1] == max(d.values())])

for ans in max_k_list:
    print(ans)

Fixed submission:
import collections

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

c = collections.Counter(polls)
maxval = c.most_common()[0][1]

values, counts = zip(*c.most_common())

ans = []

for i in c.most_common():
    if i[1] == maxval:
        ans.append(i[0])
    else:
        break

ans.sort()

for i in ans:
    print(i)