import collections

n=int(eval(input()))

s=list(eval(input()) for _ in range(n))



s1=collections.Counter(s)

s2=max(s1.values()) 

count=list(s1.values()).count(s2)

values, counts = list(zip(*s1.most_common(count)))

ans=list(values)

ans.sort()

print(('\n'.join(ans)))
import collections

n=int(eval(input()))

s=list(eval(input()) for _ in range(n))

s1=collections.Counter(s)

count=list(s1.values()).count(max(s1.values()))

values, counts = list(zip(*s1.most_common(count)))

ans=list(values)

ans.sort()

print(('\n'.join(ans)))
import collections

n = int(eval(input()))
s = list(eval(input()) for _ in range(n))
s1 = collections.Counter(s)
s2 = max(s1.values())
count = list(s1.values()).count(s2)
values, counts = list(zip(*s1.most_common(count)))
ans = list(values)
ans.sort()
print(("\n".join(ans)))

import collections

n = int(eval(input()))
s = list(eval(input()) for _ in range(n))
s1 = collections.Counter(s)
count = list(s1.values()).count(max(s1.values()))
values, counts = list(zip(*s1.most_common(count)))
ans = list(values)
ans.sort()
print(("\n".join(ans)))

-s2 = max(s1.values()) -count = list(s1.values()).count(s2) +count = list(s1.values()).count(max(s1.values()))