from collections import defaultdict
def main():
    n = int(input())
    s =defaultdict(lambda:0)
    for i in range(n):
        s[input()] += 1
    max_s = max(s.values())
    for key, value in sorted(s.items()):
        if value == max_s:
            print(key)

if __name__ == "__main__":
    main() from collections import defaultdict def main():
    n = int(input())
    s =defaultdict(lambda:0)
    for i in range(n):
        s[input()] += 1
    max_s = max(s.values())
    for key, value in sorted(s.items()):
        if value == max_s:
            print(key) main n = int(input()) n int(input()) int input() input s =defaultdict(lambda:0) s defaultdict(lambda:0) defaultdict lambda:0 0 for i in range(n):
        s[input()] += 1
     i range(n) range n s[input()] += 1 s[input()] s input() input 1 max_s = max(s.values()) max_s max(s.values()) max s.values() s.values s values for key, value in sorted(s.items()):
        if value == max_s:
            print(key) key value sorted(s.items()) sorted s.items() s.items s items if value == max_s:
            print(key) value == max_s value max_s print(key) print key if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    s =defaultdict(lambda:0)
    for i in range(n):
        s[input()] += 1
    max_s = max(s.values())
    for key, value in sorted(s.items()):
        if value == max_s:
            print(key) def main():
    n = int(input())
    s =defaultdict(lambda:0)
    for i in range(n):
        s[input()] += 1
    max_s = max(s.values())
    for key, value in sorted(s.items()):
        if value == max_s:
            print(key) main
from collections import defaultdict
def main():
    n = int(input())
    s =defaultdict(lambda:0)
    for i in range(n):
        s[input()] += 1
    max_s = max(s.values())
    for key, value in sorted(s.items()):
        if value == max_s:
            print(key)

if __name__ == "__main__":
    main()