from sys import stdin
import sys
import math
from functools import reduce
import itertools

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

d = {}
for i in range(n):
    s = stdin.readline().rstrip()

    if s in d:
        d[s] += 1
    else:
        d[s] = 1

d = sorted(d.items(), key=lambda x:x[1], reverse=True)

m = d[0][1]
a = []
i = 0
for i in range(len(d)):
    if d[i][1] == m:
        a.append(d[i][0])
    else:
        break

a.sort()

for aa in a:
    print(aa) from sys import stdin import sys sys import math math from functools import reduce import itertools itertools n = int(stdin.readline().rstrip()) n int(stdin.readline().rstrip()) int stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip d = {} d {} for i in range(n):
    s = stdin.readline().rstrip()

    if s in d:
        d[s] += 1
    else:
        d[s] = 1 i range(n) range n s = stdin.readline().rstrip() s stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip if s in d:
        d[s] += 1
    else:
        d[s] = 1 s in d s d d[s] += 1 d[s] d s 1 d[s] = 1 d[s] d s 1 d = sorted(d.items(), key=lambda x:x[1], reverse=True) d sorted(d.items(), key=lambda x:x[1], reverse=True) sorted d.items() d.items d items key=lambda x:x[1] key lambda x:x[1] x[1] x 1 x reverse=True reverse True m = d[0][1] m d[0][1] [0] d 0 1 a = [] a [] i = 0 i 0 for i in range(len(d)):
    if d[i][1] == m:
        a.append(d[i][0])
    else:
        break i range(len(d)) range len(d) len d if d[i][1] == m:
        a.append(d[i][0])
    else:
        break d[i][1] == m d[i][1] [i] d i 1 m a.append(d[i][0]) a.append a append d[i][0] [i] d i 0 break a.sort() a.sort a sort for aa in a:
    print(aa) aa a print(aa) print aa n = int(stdin.readline().rstrip()) int(stdin.readline().rstrip()) n i = 0 0 i s = stdin.readline().rstrip() stdin.readline().rstrip() s d = sorted(d.items(), key=lambda x:x[1], reverse=True) sorted(d.items(), key=lambda x:x[1], reverse=True) d m = d[0][1] d[0][1] m d = {} {} d a = [] [] a
from sys import stdin
import sys
import math
from functools import reduce
import itertools

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

d = {}
for i in range(n):
    s = stdin.readline().rstrip()

    if s in d:
        d[s] += 1
    else:
        d[s] = 1

d = sorted(d.items(), key=lambda x:x[1], reverse=True)

m = d[0][1]
a = []
i = 0
for i in range(len(d)):
    if d[i][1] == m:
        a.append(d[i][0])
    else:
        break

a.sort()

for aa in a:
    print(aa)