n = int(input())

l = [input() for _ in range(n)]

d = {}

for w in l:

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

m = max(d.values())

lt = sorted(d.items(),key=lambda k:-k[1])

ans = sorted([k for k,v in lt if v==m])

print(*ans,sep='\n')

n=int(eval(input()))

c={}

for _ in range(n): s=eval(input()); c[s]=c.get(s,0)+1

m=max(c.values())

print((*sorted(k for k,v in list(c.items()) if v==m)))
n = int(input())
l = [input() for _ in range(n)]
d = {}
for w in l:
    d[w] = d.get(w, 0) + 1
m = max(d.values())
lt = sorted(d.items(), key=lambda k: -k[1])
ans = sorted([k for k, v in lt if v == m])
print(*ans, sep="\n")

n = int(eval(input()))
c = {}
for _ in range(n):
    s = eval(input())
    c[s] = c.get(s, 0) + 1
m = max(c.values())
print((*sorted(k for k, v in list(c.items()) if v == m)))

-n = int(input()) -l = [input() for _ in range(n)] -d = {} -for w in l: -    d[w] = d.get(w, 0) + 1 -m = max(d.values()) -lt = sorted(d.items(), key=lambda k: -k[1]) -ans = sorted([k for k, v in lt if v == m]) -print(*ans, sep="\n") +n = int(eval(input())) +c = {} +for _ in range(n): +    s = eval(input()) +    c[s] = c.get(s, 0) + 1 +m = max(c.values()) +print((*sorted(k for k, v in list(c.items()) if v == m)))