def main():
    n = int(input())
    s_dict = dict()

    for _ in range(n):
        s = input()
        if s in s_dict:
            s_dict[s] += 1
        else:
            s_dict[s] = 1

    max_appear = max(s_dict.values())
    lst = []

    for key, value in s_dict.items():
        if value == max_appear:
            lst.append(key)

    lst.sort()

    for s in lst:
        print(s)


if __name__ == "__main__":
    main() def main():
    n = int(input())
    s_dict = dict()

    for _ in range(n):
        s = input()
        if s in s_dict:
            s_dict[s] += 1
        else:
            s_dict[s] = 1

    max_appear = max(s_dict.values())
    lst = []

    for key, value in s_dict.items():
        if value == max_appear:
            lst.append(key)

    lst.sort()

    for s in lst:
        print(s) main n = int(input()) n int(input()) int input() input s_dict = dict() s_dict dict() dict for _ in range(n):
        s = input()
        if s in s_dict:
            s_dict[s] += 1
        else:
            s_dict[s] = 1

     _ range(n) range n s = input() s input() input if s in s_dict:
            s_dict[s] += 1
        else:
            s_dict[s] = 1

     s in s_dict s s_dict s_dict[s] += 1 s_dict[s] s_dict s 1 s_dict[s] = 1 s_dict[s] s_dict s 1 max_appear = max(s_dict.values()) max_appear max(s_dict.values()) max s_dict.values() s_dict.values s_dict values lst = [] lst [] for key, value in s_dict.items():
        if value == max_appear:
            lst.append(key)

     key value s_dict.items() s_dict.items s_dict items if value == max_appear:
            lst.append(key)

     value == max_appear value max_appear lst.append(key) lst.append lst append key lst.sort() lst.sort lst sort for s in lst:
        print(s) s lst print(s) print s if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    s_dict = dict()

    for _ in range(n):
        s = input()
        if s in s_dict:
            s_dict[s] += 1
        else:
            s_dict[s] = 1

    max_appear = max(s_dict.values())
    lst = []

    for key, value in s_dict.items():
        if value == max_appear:
            lst.append(key)

    lst.sort()

    for s in lst:
        print(s) def main():
    n = int(input())
    s_dict = dict()

    for _ in range(n):
        s = input()
        if s in s_dict:
            s_dict[s] += 1
        else:
            s_dict[s] = 1

    max_appear = max(s_dict.values())
    lst = []

    for key, value in s_dict.items():
        if value == max_appear:
            lst.append(key)

    lst.sort()

    for s in lst:
        print(s) main
def main():
    n = int(input())
    s_dict = dict()

    for _ in range(n):
        s = input()
        if s in s_dict:
            s_dict[s] += 1
        else:
            s_dict[s] = 1

    max_appear = max(s_dict.values())
    lst = []

    for key, value in s_dict.items():
        if value == max_appear:
            lst.append(key)

    lst.sort()

    for s in lst:
        print(s)


if __name__ == "__main__":
    main()
