Buggy python submission (verdict: Time Limit Exceeded):
import collections

N = int(input())
S = list(input() for i in range(N))
dict = {}

for l in S:
        if l in dict:
            dict[l] += 1;
        else:
            dict[l] = 1;

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

max_k_list.sort()

for i in max_k_list:
    print(i)


Fixed submission:
import collections

N = int(input())
S = list(input() for i in range(N))
dict = {}

for l in S:
        if l in dict:
            dict[l] += 1;
        else:
            dict[l] = 1;
            
max = max(dict.values())

max_k_list = [kv[0] for kv in dict.items() if kv[1] == max]

max_k_list.sort()

for i in max_k_list:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
import collections

N = int(input())
S = list(input() for i in range(N))

c = collections.Counter(S)

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

max_k_list.sort()

for i in max_k_list:
    print(i)


Fixed submission:
import collections

N = int(input())
S = list(input() for i in range(N))
dict = {}

for l in S:
        if l in dict:
            dict[l] += 1;
        else:
            dict[l] = 1;
            
max = max(dict.values())

max_k_list = [kv[0] for kv in dict.items() if kv[1] == max]

max_k_list.sort()

for i in max_k_list:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(input() for i in range(N))
max = 0

for i in S:
    if S.count(i) > max:
        max = S.count(i)
        List = [i]
    elif S.count(i) == max:
        List.append(i)

set = set(List)
List2 = list(set)
List2.sort()

for i in List2:
    print(i)

Fixed submission:
import collections

N = int(input())
S = list(input() for i in range(N))
dict = {}

for l in S:
        if l in dict:
            dict[l] += 1;
        else:
            dict[l] = 1;
            
max = max(dict.values())

max_k_list = [kv[0] for kv in dict.items() if kv[1] == max]

max_k_list.sort()

for i in max_k_list:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(input() for i in range(N))
set = set(S)
max = 0

for i in set:
    if S.count(i) > max:
        max = S.count(i)
        list = [i]
    elif S.count(i) == max:
        list.append(i)

list.sort()

for i in list:
    print(i)


Fixed submission:
import collections

N = int(input())
S = list(input() for i in range(N))
dict = {}

for l in S:
        if l in dict:
            dict[l] += 1;
        else:
            dict[l] = 1;
            
max = max(dict.values())

max_k_list = [kv[0] for kv in dict.items() if kv[1] == max]

max_k_list.sort()

for i in max_k_list:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(input() for i in range(N))
set = set(S)
dic = {}

for i in set:
    dic[i] = S.count(i)

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

max_k_list.sort()

for i in max_k_list:
    print(i)


Fixed submission:
import collections

N = int(input())
S = list(input() for i in range(N))
dict = {}

for l in S:
        if l in dict:
            dict[l] += 1;
        else:
            dict[l] = 1;
            
max = max(dict.values())

max_k_list = [kv[0] for kv in dict.items() if kv[1] == max]

max_k_list.sort()

for i in max_k_list:
    print(i)