# min-heap
import heapq
pq = []
heapq.heappush(pq, 456)
heapq.heappush(pq, 123)
heapq.heappush(pq, 789)
print("size : ", len(pq))
while len(pq) > 0:
print(heapq.heappop(pq))
# min-heap
from queue import PriorityQueue
pq = PriorityQueue()
pq.put(6)
pq.put(10)
pq.put(-5)
pq.put(0)
pq.put(8)
while not pq.empty():
print(pq.get())