N = int(eval(input()))

s_list = {}

for i in range(N):

  S = eval(input())

  if S in list(s_list.keys()):

    s_list[S] += 1

  else:

    s_list[S] = 0

max = 0

maxs = []

for s,c in list(s_list.items()):

  if c > max:

    maxs = [s]

    max = c

  elif c == max:

    maxs.append(s)

maxs.sort()

for m in maxs:

  print(m)
from collections import Counter

def solve():

  N = int(input())

  S = [input() for _ in range(N)]

  c = Counter(S)

  M = max(c.values())

  ans = []

  for k,v in c.items():

    if v==M:

      ans.append(k)

  ans.sort()

  return ans

print(*solve(),sep='\n')

N = int(eval(input()))
s_list = {}
for i in range(N):
    S = eval(input())
    if S in list(s_list.keys()):
        s_list[S] += 1
    else:
        s_list[S] = 0
max = 0
maxs = []
for s, c in list(s_list.items()):
    if c > max:
        maxs = [s]
        max = c
    elif c == max:
        maxs.append(s)
maxs.sort()
for m in maxs:
    print(m)

from collections import Counter


def solve():
    N = int(input())
    S = [input() for _ in range(N)]
    c = Counter(S)
    M = max(c.values())
    ans = []
    for k, v in c.items():
        if v == M:
            ans.append(k)
    ans.sort()
    return ans


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

-N = int(eval(input())) -s_list = {} -for i in range(N): -    S = eval(input()) -    if S in list(s_list.keys()): -        s_list[S] += 1 -    else: -        s_list[S] = 0 -max = 0 -maxs = [] -for s, c in list(s_list.items()): -    if c > max: -        maxs = [s] -        max = c -    elif c == max: -        maxs.append(s) -maxs.sort() -for m in maxs: -    print(m) +from collections import Counter + + +def solve(): +    N = int(input()) +    S = [input() for _ in range(N)] +    c = Counter(S) +    M = max(c.values()) +    ans = [] +    for k, v in c.items(): +        if v == M: +            ans.append(k) +    ans.sort() +    return ans + + +print(*solve(), sep="\n")