• + 0 comments

    Without modifying the code already given :)

    from collections import Counter
    
    if __name__ == '__main__':
        s = input()
        c = Counter(s)
        [print(letter, rep) for letter, rep in Counter(sorted(c.elements())).most_common(3)]