from collections import Counter


def main():
    n = int(input())
    s = (input() for i in range(n))
    d = Counter(s)
    num = d.most_common(1)[0][1]
    ans = sorted(j[0] for j in d.items() if j[1] == num)
    for i in ans:
        print(i)

main() from collections import Counter def main():
    n = int(input())
    s = (input() for i in range(n))
    d = Counter(s)
    num = d.most_common(1)[0][1]
    ans = sorted(j[0] for j in d.items() if j[1] == num)
    for i in ans:
        print(i) main 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 s = (input() for i in range(n)) s (input() for i in range(n)) d = Counter(s) d Counter(s) Counter s num = d.most_common(1)[0][1] num d.most_common(1)[0][1] [0] d.most_common(1) d.most_common d most_common 1 0 1 ans = sorted(j[0] for j in d.items() if j[1] == num) ans sorted(j[0] for j in d.items() if j[1] == num) sorted j[0] j 0 for i in ans:
        print(i) i ans print(i) print i main() main def main():
    n = int(input())
    s = (input() for i in range(n))
    d = Counter(s)
    num = d.most_common(1)[0][1]
    ans = sorted(j[0] for j in d.items() if j[1] == num)
    for i in ans:
        print(i) def main():
    n = int(input())
    s = (input() for i in range(n))
    d = Counter(s)
    num = d.most_common(1)[0][1]
    ans = sorted(j[0] for j in d.items() if j[1] == num)
    for i in ans:
        print(i) main
from collections import Counter


def main():
    n = int(input())
    s = (input() for i in range(n))
    d = Counter(s)
    num = d.most_common(1)[0][1]
    ans = sorted(j[0] for j in d.items() if j[1] == num)
    for i in ans:
        print(i)

main()