from heapq import heappop,heappush class X: def __init__(self,x,d): self.d=d self.x=x def __str__(self): return "{}:{}".forma(self.x,self.d) def __repr__(self): return str(self) def __lt__(self,other): return self.d