from collections import Counter
def main():
    n = int(input())
    s = [input() for _ in range(n)]
    s_c = Counter(s)
    s_c_max = s_c.most_common()[0][1]
    keys =[k for k, v in s_c.items() if v == s_c_max]
    keys_s = sorted(keys)
    print(*keys_s, sep='\n')

if __name__ == '__main__':
    main() from collections import Counter def main():
    n = int(input())
    s = [input() for _ in range(n)]
    s_c = Counter(s)
    s_c_max = s_c.most_common()[0][1]
    keys =[k for k, v in s_c.items() if v == s_c_max]
    keys_s = sorted(keys)
    print(*keys_s, sep='\n') main 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)] s_c = Counter(s) s_c Counter(s) Counter s s_c_max = s_c.most_common()[0][1] s_c_max s_c.most_common()[0][1] [0] s_c.most_common() s_c.most_common s_c most_common 0 1 k for k, v in s_c.items() if v == s_c_max for k, v in s_c.items() if v == s_c_max k v s_c.items() s_c.items s_c items v == s_c_max v s_c_max if v == s_c_max k keys =[k for k, v in s_c.items() if v == s_c_max] keys [k for k, v in s_c.items() if v == s_c_max] keys_s = sorted(keys) keys_s sorted(keys) sorted keys print(*keys_s, sep='\n') print *keys_s keys_s sep='\n' sep '\n' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    s = [input() for _ in range(n)]
    s_c = Counter(s)
    s_c_max = s_c.most_common()[0][1]
    keys =[k for k, v in s_c.items() if v == s_c_max]
    keys_s = sorted(keys)
    print(*keys_s, sep='\n') def main():
    n = int(input())
    s = [input() for _ in range(n)]
    s_c = Counter(s)
    s_c_max = s_c.most_common()[0][1]
    keys =[k for k, v in s_c.items() if v == s_c_max]
    keys_s = sorted(keys)
    print(*keys_s, sep='\n') main
from collections import Counter
def main():
    n = int(input())
    s = [input() for _ in range(n)]
    s_c = Counter(s)
    s_c_max = s_c.most_common()[0][1]
    keys =[k for k, v in s_c.items() if v == s_c_max]
    keys_s = sorted(keys)
    print(*keys_s, sep='\n')

if __name__ == '__main__':
    main()