import sys

from collections import Counter



input = sys.stdin.readline



n = int(input())

S = [input().rstrip() for _ in range(n)]



c = Counter(S).most_common()



words = []

max = c[0][1]

for i in range(len(c)):

    if max == c[i][1]:

        words.append(c[i][0])



words.sort()

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

import sys

from collections import Counter



input = sys.stdin.readline



n = int(input())

S = [input().rstrip() for _ in range(n)]



c = Counter(S)

max = max(c.values())



words = [k for k, v in c.items() if max == v]

words.sort()



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

import sys
from collections import Counter

input = sys.stdin.readline
n = int(input())
S = [input().rstrip() for _ in range(n)]
c = Counter(S).most_common()
words = []
max = c[0][1]
for i in range(len(c)):
    if max == c[i][1]:
        words.append(c[i][0])
words.sort()
print(*words, sep="\n")

import sys
from collections import Counter

input = sys.stdin.readline
n = int(input())
S = [input().rstrip() for _ in range(n)]
c = Counter(S)
max = max(c.values())
words = [k for k, v in c.items() if max == v]
words.sort()
print(*words, sep="\n")

-c = Counter(S).most_common() -words = [] -max = c[0][1] -for i in range(len(c)): -    if max == c[i][1]: -        words.append(c[i][0]) +c = Counter(S) +max = max(c.values()) +words = [k for k, v in c.items() if max == v]