from collections import Counter



N, *S = open(0).read().split()



C = Counter(S)



ma = max(C.values())

ans = sorted(k for k, v in list(C.items()) if v == ma)



for a in ans:

    print(a)
from collections import Counter



N, *S = open(0).read().split()



C = Counter(S)



ma = max(C.values())

ans = sorted(k for k, v in list(C.items()) if v == ma)



print(("\n".join(ans)))
from collections import Counter

N, *S = open(0).read().split()
C = Counter(S)
ma = max(C.values())
ans = sorted(k for k, v in list(C.items()) if v == ma)
for a in ans:
    print(a)

from collections import Counter

N, *S = open(0).read().split()
C = Counter(S)
ma = max(C.values())
ans = sorted(k for k, v in list(C.items()) if v == ma)
print(("\n".join(ans)))

-for a in ans: -    print(a) +print(("\n".join(ans)))