# ABC 155 C

from collections import Counter

import numpy as np

N = int(eval(input()))

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

S = np.array(S)



count = Counter(S)

max_num = max(count.values())

max_list = [i for i,j in list(count.items()) if j==max_num]



max_list.sort()

print(('\n'.join(max_list)))
import sys

from collections import Counter

N = int(sys.stdin.readline())

S = sys.stdin.read().split()



count = Counter(S)

max_num = max(count.values())

max_list = [i for i,j in list(count.items()) if j==max_num]

 

max_list.sort()

print(('\n'.join(max_list)))
# ABC 155 C
from collections import Counter
import numpy as np

N = int(eval(input()))
S = [str(eval(input())) for i in range(N)]
S = np.array(S)
count = Counter(S)
max_num = max(count.values())
max_list = [i for i, j in list(count.items()) if j == max_num]
max_list.sort()
print(("\n".join(max_list)))

import sys
from collections import Counter

N = int(sys.stdin.readline())
S = sys.stdin.read().split()
count = Counter(S)
max_num = max(count.values())
max_list = [i for i, j in list(count.items()) if j == max_num]
max_list.sort()
print(("\n".join(max_list)))

-# ABC 155 C +import sys -import numpy as np -N = int(eval(input())) -S = [str(eval(input())) for i in range(N)] -S = np.array(S) +N = int(sys.stdin.readline()) +S = sys.stdin.read().split()