#!/usr/bin/env python3
def main():
    from collections import defaultdict

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

    d = defaultdict(int)
    for s in S:
        d[s] += 1
    
    # d = sorted(d.items())
    d = sorted(d.items(), key=lambda d: d[1], reverse=True)
    res = d[0][1]
    lst = []
    for i in d:
        if res > i[1]:
            break
        lst.append(i[0])
        res = i[1]
    for i in sorted(lst):
        print(i)


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

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

    d = defaultdict(int)
    for s in S:
        d[s] += 1
    
    # d = sorted(d.items())
    d = sorted(d.items(), key=lambda d: d[1], reverse=True)
    res = d[0][1]
    lst = []
    for i in d:
        if res > i[1]:
            break
        lst.append(i[0])
        res = i[1]
    for i in sorted(lst):
        print(i) main from collections import defaultdict 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)] d = defaultdict(int) d defaultdict(int) defaultdict int for s in S:
        d[s] += 1
    
    # d = sorted(d.items())
     s S d[s] += 1 d[s] d s 1 d = sorted(d.items(), key=lambda d: d[1], reverse=True) d sorted(d.items(), key=lambda d: d[1], reverse=True) sorted d.items() d.items d items key=lambda d: d[1] key lambda d: d[1] d[1] d 1 d reverse=True reverse True res = d[0][1] res d[0][1] [0] d 0 1 lst = [] lst [] for i in d:
        if res > i[1]:
            break
        lst.append(i[0])
        res = i[1]
     i d if res > i[1]:
            break
         res > i[1] res i[1] i 1 break lst.append(i[0]) lst.append lst append i[0] i 0 res = i[1] res i[1] i 1 for i in sorted(lst):
        print(i) i sorted(lst) sorted lst print(i) print i if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    from collections import defaultdict

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

    d = defaultdict(int)
    for s in S:
        d[s] += 1
    
    # d = sorted(d.items())
    d = sorted(d.items(), key=lambda d: d[1], reverse=True)
    res = d[0][1]
    lst = []
    for i in d:
        if res > i[1]:
            break
        lst.append(i[0])
        res = i[1]
    for i in sorted(lst):
        print(i) def main():
    from collections import defaultdict

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

    d = defaultdict(int)
    for s in S:
        d[s] += 1
    
    # d = sorted(d.items())
    d = sorted(d.items(), key=lambda d: d[1], reverse=True)
    res = d[0][1]
    lst = []
    for i in d:
        if res > i[1]:
            break
        lst.append(i[0])
        res = i[1]
    for i in sorted(lst):
        print(i) main
#!/usr/bin/env python3
def main():
    from collections import defaultdict

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

    d = defaultdict(int)
    for s in S:
        d[s] += 1
    
    # d = sorted(d.items())
    d = sorted(d.items(), key=lambda d: d[1], reverse=True)
    res = d[0][1]
    lst = []
    for i in d:
        if res > i[1]:
            break
        lst.append(i[0])
        res = i[1]
    for i in sorted(lst):
        print(i)


if __name__ == '__main__':
    main()
