N = int(eval(input()))

S = list(eval(input()) for _ in range(N))



import collections

a = collections.Counter(S).most_common()

ans = []

for i in range(len(a)):

  if i == 0:

    ans.append(a[i][0])

  elif a[i - 1][1] == a[i][1]:

    ans.append(a[i][0])

  else:

    break

ans.sort()



for j in ans:

  print(j)
from collections import Counter

n = int(eval(input()))

s = Counter([eval(input()) for _ in range(n)])

before = 0

ans = []

s = s.most_common()

for i in range(len(s)):

    if before == 0: before = s[i][1]

    elif before != s[i][1]: break

    ans.append(s[i][0])

for i in sorted(ans): print(i)
N = int(eval(input()))
S = list(eval(input()) for _ in range(N))
import collections

a = collections.Counter(S).most_common()
ans = []
for i in range(len(a)):
    if i == 0:
        ans.append(a[i][0])
    elif a[i - 1][1] == a[i][1]:
        ans.append(a[i][0])
    else:
        break
ans.sort()
for j in ans:
    print(j)

from collections import Counter

n = int(eval(input()))
s = Counter([eval(input()) for _ in range(n)])
before = 0
ans = []
s = s.most_common()
for i in range(len(s)):
    if before == 0:
        before = s[i][1]
    elif before != s[i][1]:
        break
    ans.append(s[i][0])
for i in sorted(ans):
    print(i)

-N = int(eval(input())) -S = list(eval(input()) for _ in range(N)) -import collections +from collections import Counter -a = collections.Counter(S).most_common() +n = int(eval(input())) +s = Counter([eval(input()) for _ in range(n)]) +before = 0 -for i in range(len(a)): -    if i == 0: -        ans.append(a[i][0]) -    elif a[i - 1][1] == a[i][1]: -        ans.append(a[i][0]) -    else: +s = s.most_common() +for i in range(len(s)): +    if before == 0: +        before = s[i][1] +    elif before != s[i][1]: -ans.sort() -for j in ans: -    print(j) +    ans.append(s[i][0]) +for i in sorted(ans): +    print(i)