#from math import sqrt

#from heapq import heappush, heappop

#from collections import deque



n = int(eval(input()))



max_v = 0



s = {}

list = [[] for _ in range(n+1)]

for _ in range(n):

    str = eval(input())

    if str in s:

        v = s[str] + 1

    else:

        v = 1

    s[str] = v

    max_v = max(max_v, v)

    list[v].append(str)



list[max_v].sort()



for str in list[max_v]:

    print(str)

#from math import sqrt

#from heapq import heappush, heappop

#from collections import deque



n = int(eval(input()))



l = []

for _ in range(n):

    s = eval(input())

    l.append(s)



l.sort()



max_count = 0

count = 0

results = []

ps = None

for s in l:

    if s == ps or ps is None:

        count += 1

    else:

        if max_count < count:

            max_count = count

            results = [ps]

        elif count == max_count:

            results.append(ps)

        count = 1

    ps = s



if max_count < count:

    max_count = count

    results = [ps]

elif count == max_count:

    results.append(ps)



results.sort()

for str in results:

    print(str)

# from math import sqrt
# from heapq import heappush, heappop
# from collections import deque
n = int(eval(input()))
max_v = 0
s = {}
list = [[] for _ in range(n + 1)]
for _ in range(n):
    str = eval(input())
    if str in s:
        v = s[str] + 1
    else:
        v = 1
    s[str] = v
    max_v = max(max_v, v)
    list[v].append(str)
list[max_v].sort()
for str in list[max_v]:
    print(str)

# from math import sqrt
# from heapq import heappush, heappop
# from collections import deque
n = int(eval(input()))
l = []
for _ in range(n):
    s = eval(input())
    l.append(s)
l.sort()
max_count = 0
count = 0
results = []
ps = None
for s in l:
    if s == ps or ps is None:
        count += 1
    else:
        if max_count < count:
            max_count = count
            results = [ps]
        elif count == max_count:
            results.append(ps)
        count = 1
    ps = s
if max_count < count:
    max_count = count
    results = [ps]
elif count == max_count:
    results.append(ps)
results.sort()
for str in results:
    print(str)

-max_v = 0 -s = {} -list = [[] for _ in range(n + 1)] +l = [] -    str = eval(input()) -    if str in s: -        v = s[str] + 1 +    s = eval(input()) +    l.append(s) +l.sort() +max_count = 0 +count = 0 +results = [] +ps = None +for s in l: +    if s == ps or ps is None: +        count += 1 -        v = 1 -    s[str] = v -    max_v = max(max_v, v) -    list[v].append(str) -list[max_v].sort() -for str in list[max_v]: +        if max_count < count: +            max_count = count +            results = [ps] +        elif count == max_count: +            results.append(ps) +        count = 1 +    ps = s +if max_count < count: +    max_count = count +    results = [ps] +elif count == max_count: +    results.append(ps) +results.sort() +for str in results: