N=int(eval(input()))

S=[eval(input()) for _ in range(N)]

S_=list(set(S))



ans_d={s:0 for s in S_}

for s in S:

    ans_d[s]+=1



M=max(set(ans_d.values()))

for k,v in sorted(ans_d.items()):

    if v==M:

        print(k)
from collections import Counter



N=int(eval(input()))

S=[eval(input()) for _ in range(N)]



S_Counter=Counter(S)

Max=max(S_Counter.values())



print(('\n'.join(sorted(s for s,v in list(S_Counter.items()) if v==Max))))



N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
S_ = list(set(S))
ans_d = {s: 0 for s in S_}
for s in S:
    ans_d[s] += 1
M = max(set(ans_d.values()))
for k, v in sorted(ans_d.items()):
    if v == M:
        print(k)

from collections import Counter

N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
S_Counter = Counter(S)
Max = max(S_Counter.values())
print(("\n".join(sorted(s for s, v in list(S_Counter.items()) if v == Max))))

+from collections import Counter + -S_ = list(set(S)) -ans_d = {s: 0 for s in S_} -for s in S: -    ans_d[s] += 1 -M = max(set(ans_d.values())) -for k, v in sorted(ans_d.items()): -    if v == M: -        print(k) +S_Counter = Counter(S) +Max = max(S_Counter.values()) +print(("\n".join(sorted(s for s, v in list(S_Counter.items()) if v == Max))))