# C - Poll

from collections import Counter





def main():

    _, *S = open(0).read().split()

    cnt = Counter(S).most_common()

    max_votes = cnt[0][1]

    ans = []

    for a, i in cnt:

        if i < max_votes:

            break

        ans.append(a)

    ans.sort()

    print(("\n".join(map(str, ans))))





if __name__ == "__main__":

    main()

# C - Poll

from collections import Counter





def main():

    _, *S = open(0).read().split()

    cnt = Counter(S)

    max_votes = max(cnt.values())

    ans = [k for k, v in list(cnt.items()) if v == max_votes]

    ans.sort()

    print(("\n".join(ans)))





if __name__ == "__main__":

    main()

# C - Poll
from collections import Counter


def main():
    _, *S = open(0).read().split()
    cnt = Counter(S).most_common()
    max_votes = cnt[0][1]
    ans = []
    for a, i in cnt:
        if i < max_votes:
            break
        ans.append(a)
    ans.sort()
    print(("\n".join(map(str, ans))))


if __name__ == "__main__":
    main()

# C - Poll
from collections import Counter


def main():
    _, *S = open(0).read().split()
    cnt = Counter(S)
    max_votes = max(cnt.values())
    ans = [k for k, v in list(cnt.items()) if v == max_votes]
    ans.sort()
    print(("\n".join(ans)))


if __name__ == "__main__":
    main()

-    cnt = Counter(S).most_common() -    max_votes = cnt[0][1] -    ans = [] -    for a, i in cnt: -        if i < max_votes: -            break -        ans.append(a) +    cnt = Counter(S) +    max_votes = max(cnt.values()) +    ans = [k for k, v in list(cnt.items()) if v == max_votes] -    print(("\n".join(map(str, ans)))) +    print(("\n".join(ans)))