n = int(eval(input()))

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

import collections

c = collections.Counter(s).most_common()

fin = [c[0][0]]

for j in range(1,len(c)):

    if c[j][1]==c[j-1][1]:

        fin.append(c[j][0])

        continue

    break

a = sorted(fin)

for kekka in a:

    print(kekka)
n = int(eval(input()))

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

import collections

c = collections.Counter(s).most_common()

fin = [c[0][0]]

for j in range(1,len(c)):

    if c[j][1]==c[j-1][1]:

        fin.append(c[j][0])

        continue

    break

for kekka in sorted(fin):

    print(kekka)
n = int(eval(input()))
s = [eval(input()) for i in range(n)]
import collections

c = collections.Counter(s).most_common()
fin = [c[0][0]]
for j in range(1, len(c)):
    if c[j][1] == c[j - 1][1]:
        fin.append(c[j][0])
        continue
    break
a = sorted(fin)
for kekka in a:
    print(kekka)

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

c = collections.Counter(s).most_common()
fin = [c[0][0]]
for j in range(1, len(c)):
    if c[j][1] == c[j - 1][1]:
        fin.append(c[j][0])
        continue
    break
for kekka in sorted(fin):
    print(kekka)

-a = sorted(fin) -for kekka in a: +for kekka in sorted(fin):