import sys

import collections

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

a = []

for _ in range(n):

  a.append(sys.stdin.readline().strip())

c = collections.Counter(a)

maxc = max(c.values())

print((*sorted([i[0] for i in list(c.items()) if i[1] == maxc])))
from collections import Counter

def main():

  _, *A = open(0).read().split()

  c = Counter(A)

  maxc = max(c.values())

  print((*sorted([i[0] for i in list(c.items()) if i[1] == maxc])))



if __name__ == "__main__":

  main()

import sys
import collections

n = int(sys.stdin.readline())
a = []
for _ in range(n):
    a.append(sys.stdin.readline().strip())
c = collections.Counter(a)
maxc = max(c.values())
print((*sorted([i[0] for i in list(c.items()) if i[1] == maxc])))

from collections import Counter


def main():
    _, *A = open(0).read().split()
    c = Counter(A)
    maxc = max(c.values())
    print((*sorted([i[0] for i in list(c.items()) if i[1] == maxc])))


if __name__ == "__main__":
    main()

-import sys -import collections +from collections import Counter -n = int(sys.stdin.readline()) -a = [] -for _ in range(n): -    a.append(sys.stdin.readline().strip()) -c = collections.Counter(a) -maxc = max(c.values()) -print((*sorted([i[0] for i in list(c.items()) if i[1] == maxc]))) + +def main(): +    _, *A = open(0).read().split() +    c = Counter(A) +    maxc = max(c.values()) +    print((*sorted([i[0] for i in list(c.items()) if i[1] == maxc]))) + + +if __name__ == "__main__": +    main()