N=int(eval(input()))

l={}



for i in range(N):

  s=eval(input())

  if s in l:

    l[s]+=1

  else:

    l[s]=1





# l=sorted(l,key=lambda x:x[1])



# ma=max(l)

# max_value=l[ma]

max_value=0

for i in l:

  if max_value<l[i]:

    max_value=l[i]

# print(max_value)



ans=[]



for i in l:

  if max_value==l[i]:

    ans.append(i)

ans.sort()



for i in ans:

  print(i)

N=int(eval(input()))

l={}



for i in range(N):

  s=eval(input())

  if s in l:

    l[s]+=1

  else:

    l[s]=1





# l=sorted(l,key=lambda x:x[1])



# ma=max(l)

max_value=max(l.values())

# max_value=0

# for i in l:

#   if max_value<l[i]:

#     max_value=l[i]



ans=[]



for i in l:

  if max_value==l[i]:

    ans.append(i)

ans.sort()



for i in ans:

  print(i)

N = int(eval(input()))
l = {}
for i in range(N):
    s = eval(input())
    if s in l:
        l[s] += 1
    else:
        l[s] = 1
# l=sorted(l,key=lambda x:x[1])
# ma=max(l)
# max_value=l[ma]
max_value = 0
for i in l:
    if max_value < l[i]:
        max_value = l[i]
# print(max_value)
ans = []
for i in l:
    if max_value == l[i]:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

N = int(eval(input()))
l = {}
for i in range(N):
    s = eval(input())
    if s in l:
        l[s] += 1
    else:
        l[s] = 1
# l=sorted(l,key=lambda x:x[1])
# ma=max(l)
max_value = max(l.values())
# max_value=0
# for i in l:
#   if max_value<l[i]:
#     max_value=l[i]
ans = []
for i in l:
    if max_value == l[i]:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

-# max_value=l[ma] -max_value = 0 -for i in l: -    if max_value < l[i]: -        max_value = l[i] -# print(max_value) +max_value = max(l.values()) +# max_value=0 +# for i in l: +#   if max_value<l[i]: +#     max_value=l[i]