N = int(eval(input()))

S = []

for i in range(N):

    s = eval(input())

    S.append(s)



from collections import Counter

c = Counter()



for si in S:

    c[si] += 1



a = []



for k, v in list(c.items()):

    a.append([v, k])



from operator import itemgetter

a.sort(key=itemgetter(1))

a.sort(key=itemgetter(0), reverse=True)





for ai in a:

    if ai[0] == a[0][0]:

        print((ai[1]))
N = int(eval(input()))

S = []

for i in range(N):

    s = eval(input())

    S.append(s)



from collections import Counter

c = Counter()



for si in S:

    c[si] += 1



ca = []

for name, cnt in list(c.items()):

    ca.append([name, cnt])



ca.sort(key=lambda x:x[0])

ca.sort(key=lambda x:x[1], reverse=True)



max_c = ca[0][1]

for name, cnt in ca:

    if cnt == max_c:

        print(name)

N = int(eval(input()))
S = []
for i in range(N):
    s = eval(input())
    S.append(s)
from collections import Counter

c = Counter()
for si in S:
    c[si] += 1
a = []
for k, v in list(c.items()):
    a.append([v, k])
from operator import itemgetter

a.sort(key=itemgetter(1))
a.sort(key=itemgetter(0), reverse=True)
for ai in a:
    if ai[0] == a[0][0]:
        print((ai[1]))

N = int(eval(input()))
S = []
for i in range(N):
    s = eval(input())
    S.append(s)
from collections import Counter

c = Counter()
for si in S:
    c[si] += 1
ca = []
for name, cnt in list(c.items()):
    ca.append([name, cnt])
ca.sort(key=lambda x: x[0])
ca.sort(key=lambda x: x[1], reverse=True)
max_c = ca[0][1]
for name, cnt in ca:
    if cnt == max_c:
        print(name)

-a = [] -for k, v in list(c.items()): -    a.append([v, k]) -from operator import itemgetter - -a.sort(key=itemgetter(1)) -a.sort(key=itemgetter(0), reverse=True) -for ai in a: -    if ai[0] == a[0][0]: -        print((ai[1])) +ca = [] +for name, cnt in list(c.items()): +    ca.append([name, cnt]) +ca.sort(key=lambda x: x[0]) +ca.sort(key=lambda x: x[1], reverse=True) +max_c = ca[0][1] +for name, cnt in ca: +    if cnt == max_c: +        print(name)