import sys

from collections import Counter



read = sys.stdin.read



N, *S = list(map(str, read().split()))

s = Counter(S).most_common()

n = s[0][1]

answer = [i for i, j in s if j == n]

answer.sort()

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

import sys

from collections import Counter



read = sys.stdin.read



N, *S = list(map(str, read().split()))

s = Counter(S)

n = max(s.values())

answer = [i for i, j in list(s.items()) if j == n]

answer.sort()

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

import sys
from collections import Counter

read = sys.stdin.read
N, *S = list(map(str, read().split()))
s = Counter(S).most_common()
n = s[0][1]
answer = [i for i, j in s if j == n]
answer.sort()
print(("\n".join(answer)))

import sys
from collections import Counter

read = sys.stdin.read
N, *S = list(map(str, read().split()))
s = Counter(S)
n = max(s.values())
answer = [i for i, j in list(s.items()) if j == n]
answer.sort()
print(("\n".join(answer)))

-s = Counter(S).most_common() -n = s[0][1] -answer = [i for i, j in s if j == n] +s = Counter(S) +n = max(s.values()) +answer = [i for i, j in list(s.items()) if j == n]