from collections import Counter



def main():

    n = int(eval(input()))

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

    C = Counter(s)

    cl = C.most_common()

    mx = cl[0][1]

    ans = []

    for c in cl:

        if (c[1] == mx):

            ans.append(c[0])

        else:

            break

    ans.sort()

    for i in ans:

        print(i)





if __name__ == "__main__":

    main()
from collections import Counter



def main():

    n = int(eval(input()))

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

    C = Counter(s)

    mx = max(C.values())

    ans = []

    for k,v in list(C.items()):

        if v == mx:

            ans.append(k)

    ans.sort()

    print(("\n".join(ans)))





if __name__ == "__main__":

    main()
from collections import Counter


def main():
    n = int(eval(input()))
    s = [eval(input()) for _ in range(n)]
    C = Counter(s)
    cl = C.most_common()
    mx = cl[0][1]
    ans = []
    for c in cl:
        if c[1] == mx:
            ans.append(c[0])
        else:
            break
    ans.sort()
    for i in ans:
        print(i)


if __name__ == "__main__":
    main()

from collections import Counter


def main():
    n = int(eval(input()))
    s = [eval(input()) for _ in range(n)]
    C = Counter(s)
    mx = max(C.values())
    ans = []
    for k, v in list(C.items()):
        if v == mx:
            ans.append(k)
    ans.sort()
    print(("\n".join(ans)))


if __name__ == "__main__":
    main()

-    cl = C.most_common() -    mx = cl[0][1] +    mx = max(C.values()) -    for c in cl: -        if c[1] == mx: -            ans.append(c[0]) -        else: -            break +    for k, v in list(C.items()): +        if v == mx: +            ans.append(k) -    for i in ans: -        print(i) +    print(("\n".join(ans)))