N = int(input())

from collections import Counter

A = []
for _ in range(N):
    A.append(input())

B = Counter(A)
MaxC = max(B.values())
Arg = list(B.values()).count(MaxC)
C = sorted(B.items(),key=lambda x:(x[1],x[0]))[::-1]
for i in range(Arg):
    print(C[Arg-i-1][0]) N = int(input()) N int(input()) int input() input from collections import Counter A = [] A [] for _ in range(N):
    A.append(input()) _ range(N) range N A.append(input()) A.append A append input() input B = Counter(A) B Counter(A) Counter A MaxC = max(B.values()) MaxC max(B.values()) max B.values() B.values B values Arg = list(B.values()).count(MaxC) Arg list(B.values()).count(MaxC) (B.values()).count (B.values()) list B.values() B.values B values count MaxC C = sorted(B.items(),key=lambda x:(x[1],x[0]))[::-1] C sorted(B.items(),key=lambda x:(x[1],x[0]))[::-1] (B.items(),key=lambda x:(x[1],x[0])) sorted B.items() B.items B items key=lambda x:(x[1],x[0]) key lambda x:(x[1],x[0]) (x[1],x[0]) x[1] x 1 x[0] x 0 x ::-1 -1 for i in range(Arg):
    print(C[Arg-i-1][0]) i range(Arg) range Arg print(C[Arg-i-1][0]) print C[Arg-i-1][0] [Arg-i-1] C Arg-i-1 Arg-i Arg i 1 0 B = Counter(A) Counter(A) B Arg = list(B.values()).count(MaxC) list(B.values()).count(MaxC) Arg MaxC = max(B.values()) max(B.values()) MaxC N = int(input()) int(input()) N A = [] [] A C = sorted(B.items(),key=lambda x:(x[1],x[0]))[::-1] sorted(B.items(),key=lambda x:(x[1],x[0]))[::-1] C
N = int(input())

from collections import Counter

A = []
for _ in range(N):
    A.append(input())

B = Counter(A)
MaxC = max(B.values())
Arg = list(B.values()).count(MaxC)
C = sorted(B.items(),key=lambda x:(x[1],x[0]))[::-1]
for i in range(Arg):
    print(C[Arg-i-1][0])