def main():
    from sys import stdin
    from collections import Counter
    readline = stdin.readline

    n = int(readline())
    S = [readline()[:-1] for _ in [0]*n]

    s = Counter(S)
    most = s.most_common(1)[0][1]

    answers = [i[0] for i in s.items() if i[1] == most]
    answers = sorted(answers)

    for ans in answers:
        print(ans)


if __name__ == '__main__':
    main() def main():
    from sys import stdin
    from collections import Counter
    readline = stdin.readline

    n = int(readline())
    S = [readline()[:-1] for _ in [0]*n]

    s = Counter(S)
    most = s.most_common(1)[0][1]

    answers = [i[0] for i in s.items() if i[1] == most]
    answers = sorted(answers)

    for ans in answers:
        print(ans) main from sys import stdin from collections import Counter readline = stdin.readline readline stdin.readline stdin readline n = int(readline()) n int(readline()) int readline() readline readline()[:-1] for _ in [0]*n for _ in [0]*n _ [0]*n [0] 0 n for _ in [0]*n readline()[:-1] () readline :-1 -1 S = [readline()[:-1] for _ in [0]*n] S [readline()[:-1] for _ in [0]*n] s = Counter(S) s Counter(S) Counter S most = s.most_common(1)[0][1] most s.most_common(1)[0][1] [0] s.most_common(1) s.most_common s most_common 1 0 1 i[0] for i in s.items() if i[1] == most for i in s.items() if i[1] == most i s.items() s.items s items i[1] == most i[1] i 1 most if i[1] == most i[0] i 0 answers = [i[0] for i in s.items() if i[1] == most] answers [i[0] for i in s.items() if i[1] == most] answers = sorted(answers) answers sorted(answers) sorted answers for ans in answers:
        print(ans) ans answers print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    from sys import stdin
    from collections import Counter
    readline = stdin.readline

    n = int(readline())
    S = [readline()[:-1] for _ in [0]*n]

    s = Counter(S)
    most = s.most_common(1)[0][1]

    answers = [i[0] for i in s.items() if i[1] == most]
    answers = sorted(answers)

    for ans in answers:
        print(ans) def main():
    from sys import stdin
    from collections import Counter
    readline = stdin.readline

    n = int(readline())
    S = [readline()[:-1] for _ in [0]*n]

    s = Counter(S)
    most = s.most_common(1)[0][1]

    answers = [i[0] for i in s.items() if i[1] == most]
    answers = sorted(answers)

    for ans in answers:
        print(ans) main
def main():
    from sys import stdin
    from collections import Counter
    readline = stdin.readline

    n = int(readline())
    S = [readline()[:-1] for _ in [0]*n]

    s = Counter(S)
    most = s.most_common(1)[0][1]

    answers = [i[0] for i in s.items() if i[1] == most]
    answers = sorted(answers)

    for ans in answers:
        print(ans)


if __name__ == '__main__':
    main()