

n = int (eval(input ()))

s = []

ha = {}

for i in range (n) :

    s.append (eval(input ()))

    if (s[i] not in list(ha.keys())) :

        ha[s[i]] = 1

    else :

        ha[s[i]] += 1



ans = sorted (list(ha.items()), key=lambda x : x[1], reverse=True)



k = ans[0][1]

i = 0

while (i < len (ans) and ans[i][1] == k) :

    i += 1



ans = ans[ : i]

ans.sort()

for ss in ans :

    print((ss[0]))



N = int(eval(input()))

 

dict = {}

strings = []

for i in range(N):

    x = eval(input())

    if x in list(dict.keys()):

        dict[x] += 1

    else:

        dict[x] = 1

 

maximum = 1

for i in dict:

    maximum = max(maximum,dict[i])

 

for word in dict:

    if dict[word] == maximum:

        strings.append(word)

strings.sort()

for word in strings:

    print(word)
n = int(eval(input()))
s = []
ha = {}
for i in range(n):
    s.append(eval(input()))
    if s[i] not in list(ha.keys()):
        ha[s[i]] = 1
    else:
        ha[s[i]] += 1
ans = sorted(list(ha.items()), key=lambda x: x[1], reverse=True)
k = ans[0][1]
i = 0
while i < len(ans) and ans[i][1] == k:
    i += 1
ans = ans[:i]
ans.sort()
for ss in ans:
    print((ss[0]))

N = int(eval(input()))
dict = {}
strings = []
for i in range(N):
    x = eval(input())
    if x in list(dict.keys()):
        dict[x] += 1
    else:
        dict[x] = 1
maximum = 1
for i in dict:
    maximum = max(maximum, dict[i])
for word in dict:
    if dict[word] == maximum:
        strings.append(word)
strings.sort()
for word in strings:
    print(word)

-n = int(eval(input())) -s = [] -ha = {} -for i in range(n): -    s.append(eval(input())) -    if s[i] not in list(ha.keys()): -        ha[s[i]] = 1 +N = int(eval(input())) +dict = {} +strings = [] +for i in range(N): +    x = eval(input()) +    if x in list(dict.keys()): +        dict[x] += 1 -        ha[s[i]] += 1 -ans = sorted(list(ha.items()), key=lambda x: x[1], reverse=True) -k = ans[0][1] -i = 0 -while i < len(ans) and ans[i][1] == k: -    i += 1 -ans = ans[:i] -ans.sort() -for ss in ans: -    print((ss[0])) +        dict[x] = 1 +maximum = 1 +for i in dict: +    maximum = max(maximum, dict[i]) +for word in dict: +    if dict[word] == maximum: +        strings.append(word) +strings.sort() +for word in strings: +    print(word)