from collections import Counter


def main():
    n = int(input())
    S = [input() for _ in range(n)]
    S_c = Counter(S)
    num = list(S_c.values()).count(max(list(S_c.values())))
    anss = S_c.most_common()[:num]
    for ans in sorted(anss):
        print(ans[0])


if __name__ == '__main__':
    main() from collections import Counter def main():
    n = int(input())
    S = [input() for _ in range(n)]
    S_c = Counter(S)
    num = list(S_c.values()).count(max(list(S_c.values())))
    anss = S_c.most_common()[:num]
    for ans in sorted(anss):
        print(ans[0]) main n = int(input()) n int(input()) int input() input input() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input() input S = [input() for _ in range(n)] S [input() for _ in range(n)] S_c = Counter(S) S_c Counter(S) Counter S num = list(S_c.values()).count(max(list(S_c.values()))) num list(S_c.values()).count(max(list(S_c.values()))) (S_c.values()).count (S_c.values()) list S_c.values() S_c.values S_c values count max(list(S_c.values())) max list(S_c.values()) list S_c.values() S_c.values S_c values anss = S_c.most_common()[:num] anss S_c.most_common()[:num] S_c.most_common() S_c.most_common S_c most_common :num num for ans in sorted(anss):
        print(ans[0]) ans sorted(anss) sorted anss print(ans[0]) print ans[0] ans 0 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    S = [input() for _ in range(n)]
    S_c = Counter(S)
    num = list(S_c.values()).count(max(list(S_c.values())))
    anss = S_c.most_common()[:num]
    for ans in sorted(anss):
        print(ans[0]) def main():
    n = int(input())
    S = [input() for _ in range(n)]
    S_c = Counter(S)
    num = list(S_c.values()).count(max(list(S_c.values())))
    anss = S_c.most_common()[:num]
    for ans in sorted(anss):
        print(ans[0]) main
from collections import Counter


def main():
    n = int(input())
    S = [input() for _ in range(n)]
    S_c = Counter(S)
    num = list(S_c.values()).count(max(list(S_c.values())))
    anss = S_c.most_common()[:num]
    for ans in sorted(anss):
        print(ans[0])


if __name__ == '__main__':
    main()
