n=int(eval(input()))

d={}

a=[]

for i in range(n):

  s=eval(input())

  if s not in d:

    d[s]=1

  else:

    d[s]+=1

    

m=max(d.values())



for keys in list(d.keys()):

  if d[keys]==m:

    a.append(keys)

a=sorted(a)



for word in a:

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

s={}

l=[]

for i in range(n):

  a=eval(input())

  if a in s:

    s[a]+=1

  else:

    s[a]=1

    

cou=max(s.values())



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

  if v==cou:

    l.append(k)

    

ans=sorted(l)



for i in ans:

  print(i)
n = int(eval(input()))
d = {}
a = []
for i in range(n):
    s = eval(input())
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1
m = max(d.values())
for keys in list(d.keys()):
    if d[keys] == m:
        a.append(keys)
a = sorted(a)
for word in a:
    print(word)

n = int(eval(input()))
s = {}
l = []
for i in range(n):
    a = eval(input())
    if a in s:
        s[a] += 1
    else:
        s[a] = 1
cou = max(s.values())
for k, v in list(s.items()):
    if v == cou:
        l.append(k)
ans = sorted(l)
for i in ans:
    print(i)

-d = {} -a = [] +s = {} +l = [] -    s = eval(input()) -    if s not in d: -        d[s] = 1 +    a = eval(input()) +    if a in s: +        s[a] += 1 -        d[s] += 1 -m = max(d.values()) -for keys in list(d.keys()): -    if d[keys] == m: -        a.append(keys) -a = sorted(a) -for word in a: -    print(word) +        s[a] = 1 +cou = max(s.values()) +for k, v in list(s.items()): +    if v == cou: +        l.append(k) +ans = sorted(l) +for i in ans: +    print(i)