heapq+dict