N = int(eval(input()))

S = ['0'] * N

for i in range(N):

    S[i] = eval(input())

import collections

c = collections.Counter(S)

li = list(c.values())

ca = list(c.keys())

li.sort()

max = li[-1]

from collections import deque

lia = deque()

for i in ca:

    if c[i] == max:

        lia.append(i)

liaa = list(lia)

liaa.sort()

n = len(lia)

for i in range(n):

    print((liaa[i]))
#template

def inputlist(): return [int(k) for k in input().split()]

#template

N = int(eval(input()))

s = [0]*N

for i in range(N):

    s[i] = eval(input())

from collections import Counter

c = Counter(s)

li = []

m = max(list(c.values()))

for i in list(c.keys()):

    if c[i] == m:

        li.append(i)

li.sort()

for i in range(len(li)):

    print((li[i]))
N = int(eval(input()))
S = ["0"] * N
for i in range(N):
    S[i] = eval(input())
import collections

c = collections.Counter(S)
li = list(c.values())
ca = list(c.keys())
li.sort()
max = li[-1]
from collections import deque

lia = deque()
for i in ca:
    if c[i] == max:
        lia.append(i)
liaa = list(lia)
liaa.sort()
n = len(lia)
for i in range(n):
    print((liaa[i]))

# template
def inputlist():
    return [int(k) for k in input().split()]


# template
N = int(eval(input()))
s = [0] * N
for i in range(N):
    s[i] = eval(input())
from collections import Counter

c = Counter(s)
li = []
m = max(list(c.values()))
for i in list(c.keys()):
    if c[i] == m:
        li.append(i)
li.sort()
for i in range(len(li)):
    print((li[i]))

+# template +def inputlist(): +    return [int(k) for k in input().split()] + + +# template -S = ["0"] * N +s = [0] * N -    S[i] = eval(input()) -import collections +    s[i] = eval(input()) +from collections import Counter -c = collections.Counter(S) -li = list(c.values()) -ca = list(c.keys()) +c = Counter(s) +li = [] +m = max(list(c.values())) +for i in list(c.keys()): +    if c[i] == m: +        li.append(i) -max = li[-1] -from collections import deque - -lia = deque() -for i in ca: -    if c[i] == max: -        lia.append(i) -liaa = list(lia) -liaa.sort() -n = len(lia) -for i in range(n): -    print((liaa[i])) +for i in range(len(li)): +    print((li[i]))