• + 0 comments

    def count(s): s = sorted(s) count_letters = {} for char in s: count_letters[char] = count_letters.get(char, 0)+1 arr = sorted(count_letters.items(), key=lambda x: x[1] , reverse=True)

    for i in range(3):
        print(arr[i][0], arr[i][1])
    

    if name == 'main': count(input())