






'''simple docstring'''







import heapq as hq
import math
from collections.abc import Iterator

class _lowercase	:




							def __init__(							self:				int			,							UpperCamelCase__:				int     ):
														lowerCamelCase__					:	List[str]         =       str(id_     )
														lowerCamelCase__					:	Union[str, Any]         =       None
														lowerCamelCase__					:	Dict         =       None
														lowerCamelCase__					:	Optional[int]         =       []
														lowerCamelCase__					:	int         =       {}  # {vertex:distance}




							def __lt__(							self:				List[str]			,							UpperCamelCase__:				Dict     ):
														return self.key < other.key




							def __repr__(							self:				str     ):
														return self.id




							def 		lowerCamelCase_				(							self:				Any			,							UpperCamelCase__:				int     ):
														self.neighbors.append(UpperCamelCase__     )




							def 		lowerCamelCase_				(							self:				Union[str, Any]			,							UpperCamelCase__:				Optional[Any]			,							UpperCamelCase__:				Optional[int]     ):
														lowerCamelCase__					:	Any         =       weight





def  SCREAMING_SNAKE_CASE_       (UpperCamelCase				,			UpperCamelCase				,			UpperCamelCase				,			UpperCamelCase      )      ->       Union[str, Any]:
							# add the neighbors:
							graph[a - 1].add_neighbor(graph[b - 1]      )
							graph[b - 1].add_neighbor(graph[a - 1]      )
							# add the edges:
							graph[a - 1].add_edge(graph[b - 1]				,			UpperCamelCase      )
							graph[b - 1].add_edge(graph[a - 1]				,			UpperCamelCase      )





def  SCREAMING_SNAKE_CASE_       (UpperCamelCase				,			UpperCamelCase      )      ->       list:
							lowerCamelCase__					:	List[Any]         =       []
							for u in graph:
														lowerCamelCase__					:	Optional[int]         =       math.inf
														lowerCamelCase__					:	List[str]         =       None
							lowerCamelCase__					:	List[str]         =       0
							lowerCamelCase__					:	Dict         =       graph[:]
							while q:
														lowerCamelCase__					:	Dict         =       min(UpperCamelCase      )
														q.remove(UpperCamelCase      )
														for v in u.neighbors:
																					if (v in q) and (u.edges[v.id] < v.key):
																												lowerCamelCase__					:	str         =       u
																												lowerCamelCase__					:	Dict         =       u.edges[v.id]
							for i in range(1				,			len(UpperCamelCase      )      ):
														a.append((int(graph[i].id      ) + 1, int(graph[i].pi.id      ) + 1)      )
							return a





def  SCREAMING_SNAKE_CASE_       (UpperCamelCase				,			UpperCamelCase      )      ->       Iterator[tuple]:
							for u in graph:
														lowerCamelCase__					:	Union[str, Any]         =       math.inf
														lowerCamelCase__					:	Tuple         =       None
							lowerCamelCase__					:	List[str]         =       0

							lowerCamelCase__					:	Optional[Any]         =       list(UpperCamelCase      )
							hq.heapify(UpperCamelCase      )

							while h:
														lowerCamelCase__					:	Dict         =       hq.heappop(UpperCamelCase      )
														for v in u.neighbors:
																					if (v in h) and (u.edges[v.id] < v.key):
																												lowerCamelCase__					:	int         =       u
																												lowerCamelCase__					:	Optional[int]         =       u.edges[v.id]
																												hq.heapify(UpperCamelCase      )

							for i in range(1				,			len(UpperCamelCase      )      ):
														yield (int(graph[i].id      ) + 1, int(graph[i].pi.id      ) + 1)





def  SCREAMING_SNAKE_CASE_       ()      ->       None:
							pass


if __name__ == "__main__":
			import doctest

			doctest.testmod()








"""simple docstring"""




def 						UpperCAmelCase__		(     _UpperCAmelCase					):






  """simple docstring"""





  if isinstance(_UpperCAmelCase ,					_UpperCAmelCase					):
    raise TypeError('\'float\' object cannot be interpreted as an integer'					)
  if isinstance(_UpperCAmelCase ,					_UpperCAmelCase					):
    raise TypeError('\'str\' object cannot be interpreted as an integer'					)

  if num == 0:
    return "0b0"

  A_  :       str										=  False

  if num < 0:
    A_  :       Dict										=  True
    A_  :       Union[str, Any]										=  -num

  A_  :       list[int]										=  []
  while num > 0:
    binary.insert(0 ,					num % 2					)
    num >>= 1

  if negative:
    return "-0b" + "".join(str(_UpperCAmelCase					) for e in binary					)

  return "0b" + "".join(str(_UpperCAmelCase					) for e in binary					)


if __name__ == "__main__":
   import doctest

   doctest.testmod()