• + 0 comments

    As a one-liner (with one import: from collections import Counter):

    print('\n'.join(f'{k} {v}' for k, v in Counter(sorted(input())).most_common(3)))