from collections import Counter

n = int(eval(input()))

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



c = Counter(a)

d = c.most_common()

ans = []

for i in list(c.items()):

   if i[1] == d[0][1]:

     ans.append(i[0])

for i in sorted(ans):

  print(i)

from collections import Counter





def main():

    N = int(eval(input()))

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



    c = Counter(A)

    d = c.most_common()

    ans = []

    for i in list(c.items()):

        if i[1] == d[0][1]:

            ans.append(i[0])

    for i in sorted(ans):

        print(i)





if __name__ == '__main__':

    main()

from collections import Counter

n = int(eval(input()))
a = [eval(input()) for i in range(n)]
c = Counter(a)
d = c.most_common()
ans = []
for i in list(c.items()):
    if i[1] == d[0][1]:
        ans.append(i[0])
for i in sorted(ans):
    print(i)

from collections import Counter


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


if __name__ == "__main__":
    main()

-n = int(eval(input())) -a = [eval(input()) for i in range(n)] -c = Counter(a) -d = c.most_common() -ans = [] -for i in list(c.items()): -    if i[1] == d[0][1]: -        ans.append(i[0]) -for i in sorted(ans): -    print(i) + +def main(): +    N = int(eval(input())) +    A = [eval(input()) for _ in range(N)] +    c = Counter(A) +    d = c.most_common() +    ans = [] +    for i in list(c.items()): +        if i[1] == d[0][1]: +            ans.append(i[0]) +    for i in sorted(ans): +        print(i) + + +if __name__ == "__main__": +    main()