from collections import Counter



n=int(input())

l=[input() for i in range(n)]

c=Counter(l)

d=max(c.values())

max_list=[k for k,v in c.items() if v==d]

max_list.sort()

print(*max_list,sep="\n")

from collections import Counter

a=open(0)

n=int(a.readline())

l=a.read().split()

c=Counter(l)

d=max(c.values())

max_list=[k for k,v in c.items() if v==d]

max_list.sort()

print(*max_list,sep="\n")

from collections import Counter

n = int(input())
l = [input() for i in range(n)]
c = Counter(l)
d = max(c.values())
max_list = [k for k, v in c.items() if v == d]
max_list.sort()
print(*max_list, sep="\n")

from collections import Counter

a = open(0)
n = int(a.readline())
l = a.read().split()
c = Counter(l)
d = max(c.values())
max_list = [k for k, v in c.items() if v == d]
max_list.sort()
print(*max_list, sep="\n")

-n = int(input()) -l = [input() for i in range(n)] +a = open(0) +n = int(a.readline()) +l = a.read().split()