• + 0 comments
    #!/bin/python3
    import heapq
    from collections import Counter
    
    
    if __name__ == '__main__':
        s = input(); i = 0
        tabs = Counter(s); heap = []
        
        for k,v in tabs.items():
            heapq.heappush(heap, (-v, k))
        
        while heap and i < 3:
            tmp = heapq.heappop(heap)
            print(tmp[1], -tmp[0])
            i += 1