# import sys

# input = sys.stdin.readline



N = int(eval(input()))



Slist = []

for i in range(N):

    Slist.append(eval(input()))

    # if S in Slist.keys():

    #     Slist[S] += 1

    #     if Slist[S] > maxNum:

    #         maxNum = Slist[S]

    # else:

    #     Slist[S] = 1

Slist.sort()



max_cnt = 1

cnt = 1

s_old = Slist[0]

max_Slist = []



for i in range(1,N):

    if Slist[i] == s_old:

        cnt += 1

    else:

        if cnt > max_cnt:

            max_cnt = cnt

            max_Slist = [s_old]

        elif cnt == max_cnt:

            max_Slist.append(s_old)

        s_old = Slist[i]

        cnt = 1



if Slist[N-1] == s_old:

    if cnt > max_cnt:

        max_Slist = [s_old]

    elif cnt == max_cnt:

        max_Slist.append(s_old)



for str in max_Slist:

    print(str)
import sys

input = sys.stdin.readline



N = int(eval(input()))



Slist = []

for i in range(N):

    Slist.append(eval(input()))

    # if S in Slist.keys():

    #     Slist[S] += 1

    #     if Slist[S] > maxNum:

    #         maxNum = Slist[S]

    # else:

    #     Slist[S] = 1

Slist.sort()



max_cnt = 1

cnt = 1

s_old = Slist[0]

max_Slist = []



for i in range(1,N):

    if Slist[i] == s_old:

        cnt += 1

    else:

        if cnt > max_cnt:

            max_cnt = cnt

            max_Slist = [s_old]

        elif cnt == max_cnt:

            max_Slist.append(s_old)

        s_old = Slist[i]

        cnt = 1



if Slist[N-1] == s_old:

    if cnt > max_cnt:

        max_Slist = [s_old]

    elif cnt == max_cnt:

        max_Slist.append(s_old)



for str in max_Slist:

    print(str)

# import sys
# input = sys.stdin.readline
N = int(eval(input()))
Slist = []
for i in range(N):
    Slist.append(eval(input()))
    # if S in Slist.keys():
    #     Slist[S] += 1
    #     if Slist[S] > maxNum:
    #         maxNum = Slist[S]
    # else:
    #     Slist[S] = 1
Slist.sort()
max_cnt = 1
cnt = 1
s_old = Slist[0]
max_Slist = []
for i in range(1, N):
    if Slist[i] == s_old:
        cnt += 1
    else:
        if cnt > max_cnt:
            max_cnt = cnt
            max_Slist = [s_old]
        elif cnt == max_cnt:
            max_Slist.append(s_old)
        s_old = Slist[i]
        cnt = 1
if Slist[N - 1] == s_old:
    if cnt > max_cnt:
        max_Slist = [s_old]
    elif cnt == max_cnt:
        max_Slist.append(s_old)
for str in max_Slist:
    print(str)

import sys

input = sys.stdin.readline
N = int(eval(input()))
Slist = []
for i in range(N):
    Slist.append(eval(input()))
    # if S in Slist.keys():
    #     Slist[S] += 1
    #     if Slist[S] > maxNum:
    #         maxNum = Slist[S]
    # else:
    #     Slist[S] = 1
Slist.sort()
max_cnt = 1
cnt = 1
s_old = Slist[0]
max_Slist = []
for i in range(1, N):
    if Slist[i] == s_old:
        cnt += 1
    else:
        if cnt > max_cnt:
            max_cnt = cnt
            max_Slist = [s_old]
        elif cnt == max_cnt:
            max_Slist.append(s_old)
        s_old = Slist[i]
        cnt = 1
if Slist[N - 1] == s_old:
    if cnt > max_cnt:
        max_Slist = [s_old]
    elif cnt == max_cnt:
        max_Slist.append(s_old)
for str in max_Slist:
    print(str)

-# import sys -# input = sys.stdin.readline +import sys + +input = sys.stdin.readline