from collections import defaultdict

def main():
    N = int(input())

    dd = defaultdict(int)

    for _ in range(N):
        si = input()
        dd[si] += 1

    maxv = max(dd.items(), key = lambda item: item[1])[-1]
    strings = [key for key, val in dd.items() if val == maxv]

    strings = sorted(strings)

    for string in strings:
        print(string)

if __name__ == '__main__':
    main() from collections import defaultdict def main():
    N = int(input())

    dd = defaultdict(int)

    for _ in range(N):
        si = input()
        dd[si] += 1

    maxv = max(dd.items(), key = lambda item: item[1])[-1]
    strings = [key for key, val in dd.items() if val == maxv]

    strings = sorted(strings)

    for string in strings:
        print(string) main N = int(input()) N int(input()) int input() input dd = defaultdict(int) dd defaultdict(int) defaultdict int for _ in range(N):
        si = input()
        dd[si] += 1

     _ range(N) range N si = input() si input() input dd[si] += 1 dd[si] dd si 1 maxv = max(dd.items(), key = lambda item: item[1])[-1] maxv max(dd.items(), key = lambda item: item[1])[-1] (dd.items(), key = lambda item: item[1]) max dd.items() dd.items dd items key = lambda item: item[1] key lambda item: item[1] item[1] item 1 item -1 key for key, val in dd.items() if val == maxv for key, val in dd.items() if val == maxv key val dd.items() dd.items dd items val == maxv val maxv if val == maxv key strings = [key for key, val in dd.items() if val == maxv] strings [key for key, val in dd.items() if val == maxv] strings = sorted(strings) strings sorted(strings) sorted strings for string in strings:
        print(string) string strings print(string) print string if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N = int(input())

    dd = defaultdict(int)

    for _ in range(N):
        si = input()
        dd[si] += 1

    maxv = max(dd.items(), key = lambda item: item[1])[-1]
    strings = [key for key, val in dd.items() if val == maxv]

    strings = sorted(strings)

    for string in strings:
        print(string) def main():
    N = int(input())

    dd = defaultdict(int)

    for _ in range(N):
        si = input()
        dd[si] += 1

    maxv = max(dd.items(), key = lambda item: item[1])[-1]
    strings = [key for key, val in dd.items() if val == maxv]

    strings = sorted(strings)

    for string in strings:
        print(string) main
from collections import defaultdict

def main():
    N = int(input())

    dd = defaultdict(int)

    for _ in range(N):
        si = input()
        dd[si] += 1

    maxv = max(dd.items(), key = lambda item: item[1])[-1]
    strings = [key for key, val in dd.items() if val == maxv]

    strings = sorted(strings)

    for string in strings:
        print(string)

if __name__ == '__main__':
    main()
