# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

    n = int(input().rstrip())

    s_list = [input().rstrip() for _ in range(n)]

    from collections import Counter
    c = Counter(s_list)

    max_count = c.most_common()[0][1]

    words = [word for word, count in c.most_common() if count == max_count]
    words.sort()
    print("\n".join(words))




if __name__ == "__main__":
    resolve() def resolve():
    import sys
    input = sys.stdin.readline

    n = int(input().rstrip())

    s_list = [input().rstrip() for _ in range(n)]

    from collections import Counter
    c = Counter(s_list)

    max_count = c.most_common()[0][1]

    words = [word for word, count in c.most_common() if count == max_count]
    words.sort()
    print("\n".join(words)) resolve import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline n = int(input().rstrip()) n int(input().rstrip()) int input().rstrip() ().rstrip () input rstrip input().rstrip() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input().rstrip() ().rstrip () input rstrip s_list = [input().rstrip() for _ in range(n)] s_list [input().rstrip() for _ in range(n)] from collections import Counter c = Counter(s_list) c Counter(s_list) Counter s_list max_count = c.most_common()[0][1] max_count c.most_common()[0][1] [0] c.most_common() c.most_common c most_common 0 1 word for word, count in c.most_common() if count == max_count for word, count in c.most_common() if count == max_count word count c.most_common() c.most_common c most_common count == max_count count max_count if count == max_count word words = [word for word, count in c.most_common() if count == max_count] words [word for word, count in c.most_common() if count == max_count] words.sort() words.sort words sort print("\n".join(words)) print "\n".join(words) "\n".join "\n" join words if __name__ == "__main__":
    resolve() __name__ == "__main__" __name__ "__main__" resolve() resolve def resolve():
    import sys
    input = sys.stdin.readline

    n = int(input().rstrip())

    s_list = [input().rstrip() for _ in range(n)]

    from collections import Counter
    c = Counter(s_list)

    max_count = c.most_common()[0][1]

    words = [word for word, count in c.most_common() if count == max_count]
    words.sort()
    print("\n".join(words)) def resolve():
    import sys
    input = sys.stdin.readline

    n = int(input().rstrip())

    s_list = [input().rstrip() for _ in range(n)]

    from collections import Counter
    c = Counter(s_list)

    max_count = c.most_common()[0][1]

    words = [word for word, count in c.most_common() if count == max_count]
    words.sort()
    print("\n".join(words)) resolve
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

    n = int(input().rstrip())

    s_list = [input().rstrip() for _ in range(n)]

    from collections import Counter
    c = Counter(s_list)

    max_count = c.most_common()[0][1]

    words = [word for word, count in c.most_common() if count == max_count]
    words.sort()
    print("\n".join(words))




if __name__ == "__main__":
    resolve()
