N=int(eval(input()))

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

from collections import Counter

A=Counter(A)

ret = []

a=((A.most_common(1))[0])[1]

for i in A.most_common():

  if i[1]==a:

    ret.append(i[0])

  else:

    break

ret.sort()

for i in ret:

  print(i)

#!/usr/bin python3

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



import sys

#input = sys.stdin.readline



def main():

    N = int(eval(input()))

    mp = {}

    mx = 0

    for i in range(N):

        s = eval(input())

        if s in mp:

            mp[s] += 1

            mx = max(mx, mp[s])

        else:

            mp[s] = 0

    ret = []

    for s, c in list(mp.items()):

        if c == mx:

            ret.append(s)

    ret.sort()

    print(('\n'.join(ret)))



if __name__ == '__main__':

    main()
N = int(eval(input()))
A = [eval(input()) for i in range(N)]
from collections import Counter

A = Counter(A)
ret = []
a = ((A.most_common(1))[0])[1]
for i in A.most_common():
    if i[1] == a:
        ret.append(i[0])
    else:
        break
ret.sort()
for i in ret:
    print(i)

#!/usr/bin python3
# -*- coding: utf-8 -*-
import sys

# input = sys.stdin.readline
def main():
    N = int(eval(input()))
    mp = {}
    mx = 0
    for i in range(N):
        s = eval(input())
        if s in mp:
            mp[s] += 1
            mx = max(mx, mp[s])
        else:
            mp[s] = 0
    ret = []
    for s, c in list(mp.items()):
        if c == mx:
            ret.append(s)
    ret.sort()
    print(("\n".join(ret)))


if __name__ == "__main__":
    main()

-N = int(eval(input())) -A = [eval(input()) for i in range(N)] -from collections import Counter +#!/usr/bin python3 +# -*- coding: utf-8 -*- +import sys -A = Counter(A) -ret = [] -a = ((A.most_common(1))[0])[1] -for i in A.most_common(): -    if i[1] == a: -        ret.append(i[0]) -    else: -        break -ret.sort() -for i in ret: -    print(i) +# input = sys.stdin.readline +def main(): +    N = int(eval(input())) +    mp = {} +    mx = 0 +    for i in range(N): +        s = eval(input()) +        if s in mp: +            mp[s] += 1 +            mx = max(mx, mp[s]) +        else: +            mp[s] = 0 +    ret = [] +    for s, c in list(mp.items()): +        if c == mx: +            ret.append(s) +    ret.sort() +    print(("\n".join(ret))) + + +if __name__ == "__main__": +    main()