• + 0 comments
    if __name__ == '__main__':
        s = input()
        d = dict()
        for letter in s:
            d[letter] = d.setdefault(letter, 0) + 1
        sorted_list = sorted(d.items(), key=lambda x: (-x[1], x[0]))
        for item in sorted_list[:3]:
            print(*item)