import collections
import itertools
N = int(input())
P = [input() for i in range(N)]
ans =[]

counter = collections.Counter(P)
mode_v = counter.most_common()[0][-1]
it = list(itertools.takewhile(lambda kv: kv[-1] == mode_v, counter.most_common()))
for i in range(len(it)):
    ans.append(it[i][0])
s_ans = sorted(ans)
for i in range(len(s_ans)):
    print(s_ans[i]) import collections collections import itertools itertools N = int(input()) N int(input()) int input() input input() for i in range(N) for i in range(N) i range(N) range N for i in range(N) input() input P = [input() for i in range(N)] P [input() for i in range(N)] ans =[] ans [] counter = collections.Counter(P) counter collections.Counter(P) collections.Counter collections Counter P mode_v = counter.most_common()[0][-1] mode_v counter.most_common()[0][-1] [0] counter.most_common() counter.most_common counter most_common 0 -1 it = list(itertools.takewhile(lambda kv: kv[-1] == mode_v, counter.most_common())) it list(itertools.takewhile(lambda kv: kv[-1] == mode_v, counter.most_common())) list itertools.takewhile(lambda kv: kv[-1] == mode_v, counter.most_common()) itertools.takewhile itertools takewhile lambda kv: kv[-1] == mode_v kv[-1] == mode_v kv[-1] kv -1 mode_v kv counter.most_common() counter.most_common counter most_common for i in range(len(it)):
    ans.append(it[i][0]) i range(len(it)) range len(it) len it ans.append(it[i][0]) ans.append ans append it[i][0] [i] it i 0 s_ans = sorted(ans) s_ans sorted(ans) sorted ans for i in range(len(s_ans)):
    print(s_ans[i]) i range(len(s_ans)) range len(s_ans) len s_ans print(s_ans[i]) print s_ans[i] s_ans i mode_v = counter.most_common()[0][-1] counter.most_common()[0][-1] mode_v ans =[] [] ans counter = collections.Counter(P) collections.Counter(P) counter P = [input() for i in range(N)] [input() for i in range(N)] P N = int(input()) int(input()) N it = list(itertools.takewhile(lambda kv: kv[-1] == mode_v, counter.most_common())) list(itertools.takewhile(lambda kv: kv[-1] == mode_v, counter.most_common())) it s_ans = sorted(ans) sorted(ans) s_ans
import collections
import itertools
N = int(input())
P = [input() for i in range(N)]
ans =[]

counter = collections.Counter(P)
mode_v = counter.most_common()[0][-1]
it = list(itertools.takewhile(lambda kv: kv[-1] == mode_v, counter.most_common()))
for i in range(len(it)):
    ans.append(it[i][0])
s_ans = sorted(ans)
for i in range(len(s_ans)):
    print(s_ans[i])