Buggy python submission (verdict: Runtime Error):
if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    s_most = s.most_common()

    print(s_most[0])

    for i in range(1,len(s_most)):
        if s_most[i]==s_most[0]:
            print(s_most[i])
        else:
            break

Fixed submission:
from collections import Counter

if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    s_most = Counter(s).most_common()

    ans_list = [s_most[0][0]]
    for i in range(1,len(s_most)):
        if s_most[i][1]==s_most[0][1]:
            ans_list.append(s_most[i][0])
        else:
            break

    ans_list.sort()

    for i in range(len(ans_list)):
        print(ans_list[i])

Buggy python submission (verdict: Runtime Error):
import pandas as pd

if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    dict_s=dict()
    dict_s["s"]=s
    df_s = pd.DataFrame(dict_s)

    df_s_grp = df_s.groupby("s").size()
    
    max_size = df_s_grp.max()

    ans_list = df_s_grp[df_s_grp==max_size].index

    for i in range(len(ans_list)):
        print(str(ans_list[i]))

Fixed submission:
from collections import Counter

if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    s_most = Counter(s).most_common()

    ans_list = [s_most[0][0]]
    for i in range(1,len(s_most)):
        if s_most[i][1]==s_most[0][1]:
            ans_list.append(s_most[i][0])
        else:
            break

    ans_list.sort()

    for i in range(len(ans_list)):
        print(ans_list[i])

Buggy python submission (verdict: Runtime Error):
import pandas as pd

if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    dict_s=dict()
    dict_s["s"]=s
    df_s = pd.DataFrame(dict_s)

    df_s_grp = df_s.groupby("s").size()
    
    max_size = df_s_grp.max()

    ans_list = df_s_grp[df_s_grp==max_size].index

    for i in range(len(ans_list)):
        print(ans_list[i])

Fixed submission:
from collections import Counter

if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    s_most = Counter(s).most_common()

    ans_list = [s_most[0][0]]
    for i in range(1,len(s_most)):
        if s_most[i][1]==s_most[0][1]:
            ans_list.append(s_most[i][0])
        else:
            break

    ans_list.sort()

    for i in range(len(ans_list)):
        print(ans_list[i])

Buggy python submission (verdict: Time Limit Exceeded):
if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    unique_s = []
    cnt_s = []
    for i in range(n):
        if s[i] not in unique_s:
            unique_s.append(s[i])
            cnt_s.append(1)
        else:
            for j in range(len(unique_s)):
                if s[i] == unique_s[j]:
                    cnt_s[j] += 1
                    break

    max_cnt_s = max(cnt_s)
    top_list = []
    for i in range(len(cnt_s)):
        if cnt_s[i] == max_cnt_s:
            top_list.append(unique_s[i])

    top_list.sort()

    for i in range(len(top_list)):
        print(top_list[i])

Fixed submission:
from collections import Counter

if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    s_most = Counter(s).most_common()

    ans_list = [s_most[0][0]]
    for i in range(1,len(s_most)):
        if s_most[i][1]==s_most[0][1]:
            ans_list.append(s_most[i][0])
        else:
            break

    ans_list.sort()

    for i in range(len(ans_list)):
        print(ans_list[i])