import collections
N = int(input())
S = [input() for _ in range(N)]
c = collections.Counter(S)
d = c.most_common()
cnt = 0
for i in range(len(c)-1):
    if d[i][1] == d[i+1][1]:
        cnt += 1
    else:
        break
e = []
for j in range(cnt+1):
    e.append(d[j][0])
e.sort()
for k in range(len(e)):
    print(e[k]) import collections collections N = int(input()) N int(input()) int input() input input() for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) input() input S = [input() for _ in range(N)] S [input() for _ in range(N)] c = collections.Counter(S) c collections.Counter(S) collections.Counter collections Counter S d = c.most_common() d c.most_common() c.most_common c most_common cnt = 0 cnt 0 for i in range(len(c)-1):
    if d[i][1] == d[i+1][1]:
        cnt += 1
    else:
        break i range(len(c)-1) range len(c)-1 len(c) len c 1 if d[i][1] == d[i+1][1]:
        cnt += 1
    else:
        break d[i][1] == d[i+1][1] d[i][1] [i] d i 1 d[i+1][1] [i+1] d i+1 i 1 1 cnt += 1 cnt 1 break e = [] e [] for j in range(cnt+1):
    e.append(d[j][0]) j range(cnt+1) range cnt+1 cnt 1 e.append(d[j][0]) e.append e append d[j][0] [j] d j 0 e.sort() e.sort e sort for k in range(len(e)):
    print(e[k]) k range(len(e)) range len(e) len e print(e[k]) print e[k] e k cnt += 1 1 cnt e = [] [] e S = [input() for _ in range(N)] [input() for _ in range(N)] S N = int(input()) int(input()) N c = collections.Counter(S) collections.Counter(S) c cnt = 0 0 cnt d = c.most_common() c.most_common() d
import collections
N = int(input())
S = [input() for _ in range(N)]
c = collections.Counter(S)
d = c.most_common()
cnt = 0
for i in range(len(c)-1):
    if d[i][1] == d[i+1][1]:
        cnt += 1
    else:
        break
e = []
for j in range(cnt+1):
    e.append(d[j][0])
e.sort()
for k in range(len(e)):
    print(e[k])