from collections import Counter





N = int(input())

S = Counter(input() for _ in range(N))

max_app = max(S.values())

ans = sorted(k for k, v in S.items() if v == max_app)

[print(string) for string in ans]

from collections import Counter





N = int(eval(input()))

S = Counter(eval(input()) for _ in range(N))

max_app = max(S.values())

print(('\n'.join(sorted(k for k, v in list(S.items()) if v == max_app))))

from collections import Counter

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

from collections import Counter

N = int(eval(input()))
S = Counter(eval(input()) for _ in range(N))
max_app = max(S.values())
print(("\n".join(sorted(k for k, v in list(S.items()) if v == max_app))))

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