from collections import Counter





def main():

    N = int(eval(input()))

    A = [eval(input()) for _ in range(N)]



    C = Counter(A)

    most_c = C.most_common()

    max_num = most_c[0][1]

    ANS = []

    for c in most_c:

        if c[1] < max_num:

            break

        ANS.append(c[0])

    for ans in sorted(ANS):

        print(ans)





if __name__ == '__main__':

    main()

from collections import Counter





def main():

    N = int(eval(input()))

    A = [eval(input()) for _ in range(N)]



    c = Counter(A)

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

    ANS = [i[0] for i in list(c.items()) if i[1] == max_num]

    ANS.sort()

    for ans in ANS:

        print(ans)





if __name__ == '__main__':

    main()

from collections import Counter


def main():
    N = int(eval(input()))
    A = [eval(input()) for _ in range(N)]
    C = Counter(A)
    most_c = C.most_common()
    max_num = most_c[0][1]
    ANS = []
    for c in most_c:
        if c[1] < max_num:
            break
        ANS.append(c[0])
    for ans in sorted(ANS):
        print(ans)


if __name__ == "__main__":
    main()

from collections import Counter


def main():
    N = int(eval(input()))
    A = [eval(input()) for _ in range(N)]
    c = Counter(A)
    max_num = c.most_common()[0][1]
    ANS = [i[0] for i in list(c.items()) if i[1] == max_num]
    ANS.sort()
    for ans in ANS:
        print(ans)


if __name__ == "__main__":
    main()

-    C = Counter(A) -    most_c = C.most_common() -    max_num = most_c[0][1] -    ANS = [] -    for c in most_c: -        if c[1] < max_num: -            break -        ANS.append(c[0]) -    for ans in sorted(ANS): +    c = Counter(A) +    max_num = c.most_common()[0][1] +    ANS = [i[0] for i in list(c.items()) if i[1] == max_num] +    ANS.sort() +    for ans in ANS: