from collections import defaultdict

n = int(eval(input()))

d = defaultdict(int)

for i in range(n): d[eval(input())]+=1

ds = sorted(list(d.items()), key = lambda x : (-x[1], x[0]))

nmx = ds[0][1]

for i in ds:

  if nmx != i[1]: break

  print((i[0]))

from collections import defaultdict

d = defaultdict(int)

n = int(eval(input()))

for _ in range(n): d[eval(input())] += 1

s = sorted(list(d.items()), key=lambda x: (-x[1], x[0]))

nmax = s[0][1]

for i in s:

  if i[1] != nmax: break

  print((i[0]))
from collections import defaultdict

n = int(eval(input()))
d = defaultdict(int)
for i in range(n):
    d[eval(input())] += 1
ds = sorted(list(d.items()), key=lambda x: (-x[1], x[0]))
nmx = ds[0][1]
for i in ds:
    if nmx != i[1]:
        break
    print((i[0]))

from collections import defaultdict

d = defaultdict(int)
n = int(eval(input()))
for _ in range(n):
    d[eval(input())] += 1
s = sorted(list(d.items()), key=lambda x: (-x[1], x[0]))
nmax = s[0][1]
for i in s:
    if i[1] != nmax:
        break
    print((i[0]))

+d = defaultdict(int) -d = defaultdict(int) -for i in range(n): +for _ in range(n): -ds = sorted(list(d.items()), key=lambda x: (-x[1], x[0])) -nmx = ds[0][1] -for i in ds: -    if nmx != i[1]: +s = sorted(list(d.items()), key=lambda x: (-x[1], x[0])) +nmax = s[0][1] +for i in s: +    if i[1] != nmax: