from collections import Counter



N = int(eval(input()))

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

Sc = Counter(S)

Sc1 = Sc.most_common()

#print(Sc1)

m = Sc1[0][1]

ans = []

for s in Sc1:

    if s[1] == m:

        ans.append(s[0])

ans.sort()

for a in ans:

    print(a)

from collections import Counter



N = int(eval(input()))

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



Sc = Counter(S).most_common()

m = Sc[0][1]

ans = []

for s in Sc:

    if s[1] == m:

        ans.append(s[0])

    else:

        break

ans.sort()

for a in ans:

    print(a)

from collections import Counter

N = int(eval(input()))
S = [eval(input()) for i in range(N)]
Sc = Counter(S)
Sc1 = Sc.most_common()
# print(Sc1)
m = Sc1[0][1]
ans = []
for s in Sc1:
    if s[1] == m:
        ans.append(s[0])
ans.sort()
for a in ans:
    print(a)

from collections import Counter

N = int(eval(input()))
S = [eval(input()) for i in range(N)]
Sc = Counter(S).most_common()
m = Sc[0][1]
ans = []
for s in Sc:
    if s[1] == m:
        ans.append(s[0])
    else:
        break
ans.sort()
for a in ans:
    print(a)

-Sc = Counter(S) -Sc1 = Sc.most_common() -# print(Sc1) -m = Sc1[0][1] +Sc = Counter(S).most_common() +m = Sc[0][1] -for s in Sc1: +for s in Sc: +    else: +        break