from collections import Counter



N = int(eval(input()))

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



C = Counter(S).most_common()

ans = []

m = C[0][1]

for i in range(len(C)):

    if C[i][1]==m:

        ans.append(C[i][0])

    else:

        break

ans.sort()

for a in ans:

    print(a)
#!/usr/bin/env python3

#import sys; sys.stdin=open('input_file.txt')

#------------------------------------------

from collections import defaultdict

import sys

input = sys.stdin.readline

N = int(eval(input()))

D = defaultdict(int)

for i in range(N):

    D[input().rstrip()] += 1

A = []

maxv = 0

for k,v in sorted(list(D.items()),key=lambda x:x[1],reverse=True):

    if maxv > v:

        break

    maxv = v

    A.append(k)

A.sort()

print(('\n'.join(A)))

from collections import Counter

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

#!/usr/bin/env python3
# import sys; sys.stdin=open('input_file.txt')
# ------------------------------------------
from collections import defaultdict
import sys

input = sys.stdin.readline
N = int(eval(input()))
D = defaultdict(int)
for i in range(N):
    D[input().rstrip()] += 1
A = []
maxv = 0
for k, v in sorted(list(D.items()), key=lambda x: x[1], reverse=True):
    if maxv > v:
        break
    maxv = v
    A.append(k)
A.sort()
print(("\n".join(A)))

-from collections import Counter +#!/usr/bin/env python3 +# import sys; sys.stdin=open('input_file.txt') +from collections import defaultdict +import sys +input = sys.stdin.readline -S = [eval(input()) for _ in range(N)] -C = Counter(S).most_common() -ans = [] -m = C[0][1] -for i in range(len(C)): -    if C[i][1] == m: -        ans.append(C[i][0]) -    else: +D = defaultdict(int) +for i in range(N): +    D[input().rstrip()] += 1 +A = [] +maxv = 0 +for k, v in sorted(list(D.items()), key=lambda x: x[1], reverse=True): +    if maxv > v: -ans.sort() -for a in ans: -    print(a) +    maxv = v +    A.append(k) +A.sort() +print(("\n".join(A)))