n=int(eval(input()))

mx = 0

t=[]

d={}

for i in range(n):

	s=eval(input())

	t+=[s]

	d[s] = d.get(s,0)+1

	mx = max(mx,d[s])

	

v=[]

d2={}

for s in t:

	if(d[s]==mx and d2.get(s,0)==0):

		v+=[s]

		d2[s] = d2.get(s,0)+1

	

v.sort()

for s in v:

	print(s)

n = int(eval(input()))

d = {}

for i in range(n):

  s = eval(input())

  d[s] = d.get(s,0)+1

m = max(d[i] for i in d)

for s in sorted(d):

  if d[s]==m:

    print(s)
n = int(eval(input()))
mx = 0
t = []
d = {}
for i in range(n):
    s = eval(input())
    t += [s]
    d[s] = d.get(s, 0) + 1
    mx = max(mx, d[s])
v = []
d2 = {}
for s in t:
    if d[s] == mx and d2.get(s, 0) == 0:
        v += [s]
        d2[s] = d2.get(s, 0) + 1
v.sort()
for s in v:
    print(s)

n = int(eval(input()))
d = {}
for i in range(n):
    s = eval(input())
    d[s] = d.get(s, 0) + 1
m = max(d[i] for i in d)
for s in sorted(d):
    if d[s] == m:
        print(s)

-mx = 0 -t = [] -    t += [s] -    mx = max(mx, d[s]) -v = [] -d2 = {} -for s in t: -    if d[s] == mx and d2.get(s, 0) == 0: -        v += [s] -        d2[s] = d2.get(s, 0) + 1 -v.sort() -for s in v: -    print(s) +m = max(d[i] for i in d) +for s in sorted(d): +    if d[s] == m: +        print(s)