def main():

    n = int(eval(input()))

    words = [eval(input()) for i in range(n)]



    words_count = {}

    for w in words:

        words_count.setdefault(w, 0)

        words_count[w] += 1

    ans = ''

    count = 0

    for w in words_count:

        count = words_count[w] if words_count[w] > count else count

    ans = []

    for w in words_count:

        if words_count[w] == count:

            ans.append(w)

    ans = sorted(ans)

    for w in ans:

        print(w)









if __name__ == '__main__':

    main()


url = "https://atcoder.jp//contests/abc155/tasks/abc155_c"



def main():

    n = int(eval(input()))

    words = [eval(input()) for i in range(n)]



    words_count = {}

    for w in words:

        words_count.setdefault(w, 0)

        words_count[w] += 1

    ans = ''

    count = 0

    for w in words_count:

        count = words_count[w] if words_count[w] > count else count

    ans = []

    for w in words_count:

        if words_count[w] == count:

            ans.append(w)

    ans = sorted(ans)

    for w in ans:

        print(w)









if __name__ == '__main__':

    main()

def main():
    n = int(eval(input()))
    words = [eval(input()) for i in range(n)]
    words_count = {}
    for w in words:
        words_count.setdefault(w, 0)
        words_count[w] += 1
    ans = ""
    count = 0
    for w in words_count:
        count = words_count[w] if words_count[w] > count else count
    ans = []
    for w in words_count:
        if words_count[w] == count:
            ans.append(w)
    ans = sorted(ans)
    for w in ans:
        print(w)


if __name__ == "__main__":
    main()

url = "https://atcoder.jp//contests/abc155/tasks/abc155_c"


def main():
    n = int(eval(input()))
    words = [eval(input()) for i in range(n)]
    words_count = {}
    for w in words:
        words_count.setdefault(w, 0)
        words_count[w] += 1
    ans = ""
    count = 0
    for w in words_count:
        count = words_count[w] if words_count[w] > count else count
    ans = []
    for w in words_count:
        if words_count[w] == count:
            ans.append(w)
    ans = sorted(ans)
    for w in ans:
        print(w)


if __name__ == "__main__":
    main()

+url = "https://atcoder.jp//contests/abc155/tasks/abc155_c" + +