Buggy python submission (verdict: Time Limit Exceeded):
def main():   
    n = int(input())
    a = [input() for _ in range(n)]

    a_dict = {i:0 for i in set(a)}
    a_list = list(set(a))

    for i in a_list:
        a_dict[i] = a.count(i)

    ans = []
    max_value = max(a_dict.values())
    for key, value in a_dict.items():
        if value == max_value:
            ans.append(key)

    ans.sort()
    for i in ans:
        print(i)
main()

Fixed submission:
n = int(input())

# 入力データ受取り時に、辞書に追加していくやり方
s_dict = {}
for i in range(n):
    s = input()    
    if s not in s_dict:
        s_dict[s] = 1
    s_dict[s] += 1

max_value = max(s_dict.values())
ans = []
for key, value in s_dict.items():
    if value == max_value:
        ans.append(key)

ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [input() for _ in range(n)]

a_dict = {i:0 for i in set(a)}
a_list = list(set(a))

for i in a_list:
    a_dict[i] = a.count(i)

ans = []
max_value = max(a_dict.values())
for key, value in a_dict.items():
    if value == max_value:
        ans.append(key)

ans.sort()
for i in ans:
    print(i)

Fixed submission:
n = int(input())

# 入力データ受取り時に、辞書に追加していくやり方
s_dict = {}
for i in range(n):
    s = input()    
    if s not in s_dict:
        s_dict[s] = 1
    s_dict[s] += 1

max_value = max(s_dict.values())
ans = []
for key, value in s_dict.items():
    if value == max_value:
        ans.append(key)

ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [input() for _ in range(n)]
a_dict = {i:0 for i in set(a)}

for i in a:
    for j in a_dict:
        if i == j:
            a_dict[j] += 1

ans = []
max_value = max(a_dict.values())
for key, value in a_dict.items():
    if value == max_value:
        ans.append(key)

ans.sort()
for i in ans:
    print(i)

Fixed submission:
n = int(input())

# 入力データ受取り時に、辞書に追加していくやり方
s_dict = {}
for i in range(n):
    s = input()    
    if s not in s_dict:
        s_dict[s] = 1
    s_dict[s] += 1

max_value = max(s_dict.values())
ans = []
for key, value in s_dict.items():
    if value == max_value:
        ans.append(key)

ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [input() for _ in range(n)]
a_dict = {i:0 for i in set(a)}

for i in a:
    for j in a_dict:
        if i == j:
            a_dict[j] += 1

ans = []
max_value = max(a_dict.values())
for key, value in a_dict.items():
    if value == max_value:
        ans.append(key)

ans.sort()
for i in ans:
    print(i)

Fixed submission:
n = int(input())

# 入力データ受取り時に、辞書に追加していくやり方
s_dict = {}
for i in range(n):
    s = input()    
    if s not in s_dict:
        s_dict[s] = 1
    s_dict[s] += 1

max_value = max(s_dict.values())
ans = []
for key, value in s_dict.items():
    if value == max_value:
        ans.append(key)

ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [input() for _ in range(n)]
a_dict = {i:0 for i in set(a)}

for i in a:
    for j in a_dict:
        if i == j:
            a_dict[j] += 1

ans = []
for key, value in a_dict.items():
    if value == max(a_dict.values()):
        ans.append(key)

ans.sort()
for i in ans:
    print(i)

Fixed submission:
n = int(input())

# 入力データ受取り時に、辞書に追加していくやり方
s_dict = {}
for i in range(n):
    s = input()    
    if s not in s_dict:
        s_dict[s] = 1
    s_dict[s] += 1

max_value = max(s_dict.values())
ans = []
for key, value in s_dict.items():
    if value == max_value:
        ans.append(key)

ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
    a.append(input())

a_dict = {i:0 for i in set(a)}
for i in a:
    for j in a_dict:
        if i == j:
            a_dict[j] += 1

ans = []
for key, value in a_dict.items():
    if value == max(a_dict.values()):
        ans.append(key)
ans.sort()
for i in ans:
  print(i)

Fixed submission:
n = int(input())

# 入力データ受取り時に、辞書に追加していくやり方
s_dict = {}
for i in range(n):
    s = input()    
    if s not in s_dict:
        s_dict[s] = 1
    s_dict[s] += 1

max_value = max(s_dict.values())
ans = []
for key, value in s_dict.items():
    if value == max_value:
        ans.append(key)

ans.sort()
for i in ans:
    print(i)