from collections import defaultdict





dict = defaultdict(int)

n = int(eval(input()))

for _ in range(n):

    s = eval(input())

    dict[s] += 1



maxim = max(dict.values())



candidates = []



for key, count in list(dict.items()):

    if count == maxim:

        candidates.append(key)



candidates.sort()



for ans in candidates:

    print(ans)
import sys

input = sys.stdin.readline

from collections import defaultdict





dict = defaultdict(int)

n = int(input())

for _ in range(n):

    s = input()

    dict[s] += 1



maxim = max(dict.values())



candidates = []



for key, count in dict.items():

    if count == maxim:

        candidates.append(key)



candidates.sort()



print(*candidates, sep='\n')

from collections import defaultdict

dict = defaultdict(int)
n = int(eval(input()))
for _ in range(n):
    s = eval(input())
    dict[s] += 1
maxim = max(dict.values())
candidates = []
for key, count in list(dict.items()):
    if count == maxim:
        candidates.append(key)
candidates.sort()
for ans in candidates:
    print(ans)

import sys

input = sys.stdin.readline
from collections import defaultdict

dict = defaultdict(int)
n = int(input())
for _ in range(n):
    s = input()
    dict[s] += 1
maxim = max(dict.values())
candidates = []
for key, count in dict.items():
    if count == maxim:
        candidates.append(key)
candidates.sort()
print(*candidates, sep="\n")

+import sys + +input = sys.stdin.readline -n = int(eval(input())) +n = int(input()) -    s = eval(input()) +    s = input() -for key, count in list(dict.items()): +for key, count in dict.items(): -for ans in candidates: -    print(ans) +print(*candidates, sep="\n")