from collections import Counter



N = int(input())

S = [input() for _ in range(N)]

c = Counter(S)

m = max(c.values())

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

[print(k) for k in ans]

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 m==v])

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

from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
c = Counter(S)
m = max(c.values())
ans = sorted([k for k, v in c.items() if m == v])
[print(k) for k in ans]

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 m == v])
print(("\n".join(ans)))

-N = int(input()) -S = [input() for _ in range(N)] +N = int(eval(input())) +S = [eval(input()) for _ in range(N)] -ans = sorted([k for k, v in c.items() if m == v]) -[print(k) for k in ans] +ans = sorted([k for k, v in list(c.items()) if m == v]) +print(("\n".join(ans)))