# -*- coding: utf-8 -*-





def main():

    from collections import Counter



    n = int(eval(input()))

    s = [eval(input()) for _ in range(n)]

    c = sorted(list(Counter(s).items()), key=lambda x: x[1], reverse=True)

    max_value = c[0][1]

    ans = list()



    for key, value in c:

        if value == max_value:

            ans.append(key)



    for a in sorted(ans):

        print(a)





if __name__ == '__main__':

    main()

# -*- coding: utf-8 -*-





def main():

    from collections import Counter



    n = int(eval(input()))

    s = [eval(input()) for _ in range(n)]

    c = Counter(s)

    max_value = max(c.values())

    ans = list()



    for key, value in list(c.items()):

        if value == max_value:

            ans.append(key)



    for a in sorted(ans):

        print(a)





if __name__ == '__main__':

    main()

# -*- coding: utf-8 -*-
def main():
    from collections import Counter

    n = int(eval(input()))
    s = [eval(input()) for _ in range(n)]
    c = sorted(list(Counter(s).items()), key=lambda x: x[1], reverse=True)
    max_value = c[0][1]
    ans = list()
    for key, value in c:
        if value == max_value:
            ans.append(key)
    for a in sorted(ans):
        print(a)


if __name__ == "__main__":
    main()

# -*- coding: utf-8 -*-
def main():
    from collections import Counter

    n = int(eval(input()))
    s = [eval(input()) for _ in range(n)]
    c = Counter(s)
    max_value = max(c.values())
    ans = list()
    for key, value in list(c.items()):
        if value == max_value:
            ans.append(key)
    for a in sorted(ans):
        print(a)


if __name__ == "__main__":
    main()

-    c = sorted(list(Counter(s).items()), key=lambda x: x[1], reverse=True) -    max_value = c[0][1] +    c = Counter(s) +    max_value = max(c.values()) -    for key, value in c: +    for key, value in list(c.items()):