n = int(eval(input()))

S = ['']*n

T = []

for i in range(n):

    S[i] = eval(input())

S.sort()

if n == 1:

    print((S[0]))

    exit()

cnt = 1

mxcnt = 1

for i in range(n-1):

    if S[i] == S[i+1]:

        cnt += 1

    else:

        cnt = 1

    mxcnt = max(mxcnt,cnt)

cnt = 1

for i in range(n-1):

    if S[i] == S[i+1]:

        cnt += 1

    else:

        cnt = 1

    if cnt == mxcnt:

        T.append(S[i])

if mxcnt == 1:

    T.append(S[-1])

for t in T:

    print(t)
from collections import Counter

n = int(eval(input()))

s = [eval(input()) for i in range(n)]

num = Counter(s)

mx = max(num.values())

T = []

for n in sorted(num):

    if num[n] == mx:

        print(n)
n = int(eval(input()))
S = [""] * n
T = []
for i in range(n):
    S[i] = eval(input())
S.sort()
if n == 1:
    print((S[0]))
    exit()
cnt = 1
mxcnt = 1
for i in range(n - 1):
    if S[i] == S[i + 1]:
        cnt += 1
    else:
        cnt = 1
    mxcnt = max(mxcnt, cnt)
cnt = 1
for i in range(n - 1):
    if S[i] == S[i + 1]:
        cnt += 1
    else:
        cnt = 1
    if cnt == mxcnt:
        T.append(S[i])
if mxcnt == 1:
    T.append(S[-1])
for t in T:
    print(t)

from collections import Counter

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
num = Counter(s)
mx = max(num.values())
T = []
for n in sorted(num):
    if num[n] == mx:
        print(n)

+from collections import Counter + -S = [""] * n +s = [eval(input()) for i in range(n)] +num = Counter(s) +mx = max(num.values()) -for i in range(n): -    S[i] = eval(input()) -S.sort() -if n == 1: -    print((S[0])) -    exit() -cnt = 1 -mxcnt = 1 -for i in range(n - 1): -    if S[i] == S[i + 1]: -        cnt += 1 -    else: -        cnt = 1 -    mxcnt = max(mxcnt, cnt) -cnt = 1 -for i in range(n - 1): -    if S[i] == S[i + 1]: -        cnt += 1 -    else: -        cnt = 1 -    if cnt == mxcnt: -        T.append(S[i]) -if mxcnt == 1: -    T.append(S[-1]) -for t in T: -    print(t) +for n in sorted(num): +    if num[n] == mx: +        print(n)