n = int(eval(input()))

mymap = {}

for x in range(n):

	inp = eval(input())

	if inp in mymap:

		mymap[inp] += 1

	else:

		mymap[inp] = 0



sorted_map = sorted(list(mymap.items()), key=lambda kv: kv[1], reverse = True )



maxi = sorted_map[0][1]

# print(maxi)



answer = []



for x in sorted_map:

	if x[1] == maxi:

		answer.append(x[0])

	else:

		break



answer.sort()



for x in answer:

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

mymap = {}

maxi = 1

for x in range(n):

	inp = eval(input())

	if inp in mymap:

		mymap[inp] += 1

		if mymap[inp] > maxi:

			maxi = mymap[inp]

	else:

		mymap[inp] = 1



answer = []



for x in mymap:

	if mymap[x] == maxi:

		answer.append(x)



answer.sort()



for x in answer:

	print(x)
n = int(eval(input()))
mymap = {}
for x in range(n):
    inp = eval(input())
    if inp in mymap:
        mymap[inp] += 1
    else:
        mymap[inp] = 0
sorted_map = sorted(list(mymap.items()), key=lambda kv: kv[1], reverse=True)
maxi = sorted_map[0][1]
# print(maxi)
answer = []
for x in sorted_map:
    if x[1] == maxi:
        answer.append(x[0])
    else:
        break
answer.sort()
for x in answer:
    print(x)

n = int(eval(input()))
mymap = {}
maxi = 1
for x in range(n):
    inp = eval(input())
    if inp in mymap:
        mymap[inp] += 1
        if mymap[inp] > maxi:
            maxi = mymap[inp]
    else:
        mymap[inp] = 1
answer = []
for x in mymap:
    if mymap[x] == maxi:
        answer.append(x)
answer.sort()
for x in answer:
    print(x)

+maxi = 1 +        if mymap[inp] > maxi: +            maxi = mymap[inp] -        mymap[inp] = 0 -sorted_map = sorted(list(mymap.items()), key=lambda kv: kv[1], reverse=True) -maxi = sorted_map[0][1] -# print(maxi) +        mymap[inp] = 1 -for x in sorted_map: -    if x[1] == maxi: -        answer.append(x[0]) -    else: -        break +for x in mymap: +    if mymap[x] == maxi: +        answer.append(x)