import collections
def resolve():
    n = int(input())
    s = [input() for _ in range(n)]
    c = collections.Counter(s)
    max_count = c.most_common()[0][1]
    ans = [i[0] for i in c.items() if i[1]==max_count]
    for i in sorted(ans): print(i)
resolve() import collections collections def resolve():
    n = int(input())
    s = [input() for _ in range(n)]
    c = collections.Counter(s)
    max_count = c.most_common()[0][1]
    ans = [i[0] for i in c.items() if i[1]==max_count]
    for i in sorted(ans): print(i) resolve 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 max_count = c.most_common()[0][1] max_count c.most_common()[0][1] [0] c.most_common() c.most_common c most_common 0 1 i[0] for i in c.items() if i[1]==max_count for i in c.items() if i[1]==max_count i c.items() c.items c items i[1]==max_count i[1] i 1 max_count if i[1]==max_count i[0] i 0 ans = [i[0] for i in c.items() if i[1]==max_count] ans [i[0] for i in c.items() if i[1]==max_count] for i in sorted(ans): prin i sorted(ans) sorted ans resolve() resolve def resolve():
    n = int(input())
    s = [input() for _ in range(n)]
    c = collections.Counter(s)
    max_count = c.most_common()[0][1]
    ans = [i[0] for i in c.items() if i[1]==max_count]
    for i in sorted(ans): print(i) def resolve():
    n = int(input())
    s = [input() for _ in range(n)]
    c = collections.Counter(s)
    max_count = c.most_common()[0][1]
    ans = [i[0] for i in c.items() if i[1]==max_count]
    for i in sorted(ans): print(i) resolve
import collections
def resolve():
    n = int(input())
    s = [input() for _ in range(n)]
    c = collections.Counter(s)
    max_count = c.most_common()[0][1]
    ans = [i[0] for i in c.items() if i[1]==max_count]
    for i in sorted(ans): print(i)
resolve()