import sys

import math

import itertools

import numpy

import collections



rl = sys.stdin.readline



n = int(rl())



li = []

for _ in range(n):

    li.append(rl().rstrip())

c = collections.Counter(li)

max_cnt = 0

li = []

for k, v in list(c.items()):

    if v < max_cnt:

        continue

    elif v == max_cnt:

        li.append(k)

    else:

        max_cnt = v

        li = [k]

li.sort()

for i in li:

    print(i)









import sys

import math

import itertools

import numpy

import collections



rl = sys.stdin.readline



n = int(rl())



li = []

for _ in range(n):

    li.append(rl().rstrip())

c = collections.Counter(li)

max_cnt = 0

li = []

for k, v in list(c.items()):

    if v < max_cnt:

        continue

    elif v == max_cnt:

        li.append(k)

    else:

        max_cnt = v

        li = [k]

li.sort()

print(('\n'.join(li)))







import sys
import math
import itertools
import numpy
import collections

rl = sys.stdin.readline
n = int(rl())
li = []
for _ in range(n):
    li.append(rl().rstrip())
c = collections.Counter(li)
max_cnt = 0
li = []
for k, v in list(c.items()):
    if v < max_cnt:
        continue
    elif v == max_cnt:
        li.append(k)
    else:
        max_cnt = v
        li = [k]
li.sort()
for i in li:
    print(i)

import sys
import math
import itertools
import numpy
import collections

rl = sys.stdin.readline
n = int(rl())
li = []
for _ in range(n):
    li.append(rl().rstrip())
c = collections.Counter(li)
max_cnt = 0
li = []
for k, v in list(c.items()):
    if v < max_cnt:
        continue
    elif v == max_cnt:
        li.append(k)
    else:
        max_cnt = v
        li = [k]
li.sort()
print(("\n".join(li)))

-for i in li: -    print(i) +print(("\n".join(li)))