n = int(eval(input()))

s = [eval(input()) for _ in range(n)]

d = {}

for i in range(n):

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



m = max(d.values())

lst = []

for key in d:

    if d[key] == m:

        lst.append(key)



lst.sort()

for i in lst:

    print(i)





from collections import Counter

n = int(eval(input()))

s = [eval(input()) for _ in range(n)]

c = Counter(s)

m = max(c.values())

ans = sorted(k for k,v in list(c.items()) if v == m)

print(("\n".join(ans)))
n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
d = {}
for i in range(n):
    d[s[i]] = d.get(s[i], 0) + 1
m = max(d.values())
lst = []
for key in d:
    if d[key] == m:
        lst.append(key)
lst.sort()
for i in lst:
    print(i)

from collections import Counter

n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
c = Counter(s)
m = max(c.values())
ans = sorted(k for k, v in list(c.items()) if v == m)
print(("\n".join(ans)))

+from collections import Counter + -d = {} -for i in range(n): -    d[s[i]] = d.get(s[i], 0) + 1 -m = max(d.values()) -lst = [] -for key in d: -    if d[key] == m: -        lst.append(key) -lst.sort() -for i in lst: -    print(i) +c = Counter(s) +m = max(c.values()) +ans = sorted(k for k, v in list(c.items()) if v == m) +print(("\n".join(ans)))