




import sys
from collections import defaultdict






class  __magic_name__						:
    '''simple docstring'''







    def __init__(							self:   Optional[Any]		):
           SCREAMING_SNAKE_CASE_   	=    []


    def     _A							(							self:   List[Any]		,					_lowerCamelCase:   Any		):
           return self.node_position[vertex]


    def     _A							(							self:   Any		,					_lowerCamelCase:   List[Any]		,					_lowerCamelCase:   str		):
           SCREAMING_SNAKE_CASE_   	=    pos


    def     _A							(							self:   List[Any]		,					_lowerCamelCase:   int		,					_lowerCamelCase:   Dict		,					_lowerCamelCase:   int		,					_lowerCamelCase:   Optional[Any]		):



           if start > size // 2 - 1:
                  return
           else:
                  if 2 * start + 2 >= size:
                         SCREAMING_SNAKE_CASE_   	=    2 * start + 1
                  else:
                         if heap[2 * start + 1] < heap[2 * start + 2]:
                                SCREAMING_SNAKE_CASE_   	=    2 * start + 1
                         else:
                                SCREAMING_SNAKE_CASE_   	=    2 * start + 2
                  if heap[smallest_child] < heap[start]:
                         SCREAMING_SNAKE_CASE_   	=    heap[smallest_child], positions[smallest_child]
                         SCREAMING_SNAKE_CASE_   	=    (
                             heap[start],
                             positions[start],
                         )
                         SCREAMING_SNAKE_CASE_   	=    temp, tempa

                         SCREAMING_SNAKE_CASE_   	=    self.get_position(positions[smallest_child]		)
                         self.set_position(
                             positions[smallest_child]		,					self.get_position(positions[start]		)		)
                         self.set_position(positions[start]		,					a_		)

                         self.top_to_bottom(a_		,					a_		,					a_		,					a_		)


    def     _A							(							self:   Union[str, Any]		,					_lowerCamelCase:   List[Any]		,					_lowerCamelCase:   Optional[Any]		,					_lowerCamelCase:   Optional[int]		,					_lowerCamelCase:   Dict		):
           SCREAMING_SNAKE_CASE_   	=    position[index]

           while index != 0:
                  SCREAMING_SNAKE_CASE_   	=    int((index - 2) / 2		) if index % 2 == 0 else int((index - 1) / 2		)

                  if val < heap[parent]:
                         SCREAMING_SNAKE_CASE_   	=    heap[parent]
                         SCREAMING_SNAKE_CASE_   	=    position[parent]
                         self.set_position(position[parent]		,					a_		)
                  else:
                         SCREAMING_SNAKE_CASE_   	=    val
                         SCREAMING_SNAKE_CASE_   	=    temp
                         self.set_position(a_		,					a_		)
                         break
                  SCREAMING_SNAKE_CASE_   	=    parent
           else:
                  SCREAMING_SNAKE_CASE_   	=    val
                  SCREAMING_SNAKE_CASE_   	=    temp
                  self.set_position(a_		,					0		)


    def     _A							(							self:   Optional[Any]		,					_lowerCamelCase:   Optional[int]		,					_lowerCamelCase:   int		):
           SCREAMING_SNAKE_CASE_   	=    len(a_		) // 2 - 1
           for i in range(a_		,					-1		,					-1		):
                  self.top_to_bottom(a_		,					a_		,					len(a_		)		,					a_		)





    def     _A							(							self:   Optional[Any]		,					_lowerCamelCase:   List[str]		,					_lowerCamelCase:   Union[str, Any]		):
           SCREAMING_SNAKE_CASE_   	=    positions[0]
           SCREAMING_SNAKE_CASE_   	=    sys.maxsize
           self.top_to_bottom(a_		,					0		,					len(a_		)		,					a_		)
           return temp






def 			a   (_lowerCAmelCase     ):
       SCREAMING_SNAKE_CASE_   	=    Heap()

       SCREAMING_SNAKE_CASE_   	=    [0] * len(snake_case__     )
       SCREAMING_SNAKE_CASE_   	=    [-1] * len(snake_case__     )  # Neighboring Tree Vertex of selected vertex
       # Minimum Distance of explored vertex with neighboring vertex of partial tree
       # formed in graph
       SCREAMING_SNAKE_CASE_   	=    []  # Heap of Distance of vertices from their neighboring vertex
       SCREAMING_SNAKE_CASE_   	=    []

       for vertex in range(len(snake_case__     )     ):
              distance_tv.append(sys.maxsize     )
              positions.append(snake_case__     )
              heap.node_position.append(snake_case__     )

       SCREAMING_SNAKE_CASE_   	=    []
       SCREAMING_SNAKE_CASE_   	=    1
       SCREAMING_SNAKE_CASE_   	=    sys.maxsize
       for neighbor, distance in adjacency_list[0]:
              SCREAMING_SNAKE_CASE_   	=    0
              SCREAMING_SNAKE_CASE_   	=    distance
       heap.heapify(snake_case__  ,    snake_case__     )

       for _ in range(1  ,    len(snake_case__     )     ):
              SCREAMING_SNAKE_CASE_   	=    heap.delete_minimum(snake_case__  ,    snake_case__     )
              if visited[vertex] == 0:
                     tree_edges.append((nbr_tv[vertex], vertex)     )
                     SCREAMING_SNAKE_CASE_   	=    1
                     for neighbor, distance in adjacency_list[vertex]:
                            if (
                                visited[neighbor] == 0
                                and distance < distance_tv[heap.get_position(snake_case__     )]
                            ):
                                   SCREAMING_SNAKE_CASE_   	=    distance
                                   heap.bottom_to_top(
                                       snake_case__  ,    heap.get_position(snake_case__     )  ,    snake_case__  ,    snake_case__     )
                                   SCREAMING_SNAKE_CASE_   	=    vertex
       return tree_edges


if __name__ == "__main__":  # pragma: no cover
   # < --------- Prims Algorithm --------- >
   __SCREAMING_SNAKE_CASE 						=int(input("""Enter number of edges: """).strip())
   __SCREAMING_SNAKE_CASE 						=defaultdict(list)
   for _ in range(edges_number):
      __SCREAMING_SNAKE_CASE 						=[int(x) for x in input().strip().split()]
      adjacency_list[edge[0]].append([edge[1], edge[2]])
      adjacency_list[edge[1]].append([edge[0], edge[2]])
   print(prisms_algorithm(adjacency_list))








import unittest

from diffusers import FlaxAutoencoderKL
from diffusers.utils import is_flax_available
from diffusers.utils.testing_utils import require_flax

from .test_modeling_common_flax import FlaxModelTesterMixin


if is_flax_available():
			import jax






@require_flax
class  __magic_name__						(  __UpperCAmelCase    ,  unittest.TestCase):
				'''simple docstring'''







				SCREAMING_SNAKE_CASE__					:							str	      =					FlaxAutoencoderKL


				@property
				def     _A							(							self:   Any		):
											SCREAMING_SNAKE_CASE_   	=    4
											SCREAMING_SNAKE_CASE_   	=    3
											SCREAMING_SNAKE_CASE_   	=    (32, 32)

											SCREAMING_SNAKE_CASE_   	=    jax.random.PRNGKey(0		)
											SCREAMING_SNAKE_CASE_   	=    jax.random.uniform(_lowerCamelCase		,					((batch_size, num_channels) + sizes)		)

											return {"sample": image, "prng_key": prng_key}





				def     _A							(							self:   List[str]		):
											SCREAMING_SNAKE_CASE_   	=    {
											    '''block_out_channels''': [32, 64],
											    '''in_channels''': 3,
											    '''out_channels''': 3,
											    '''down_block_types''': ['''DownEncoderBlock2D''', '''DownEncoderBlock2D'''],
											    '''up_block_types''': ['''UpDecoderBlock2D''', '''UpDecoderBlock2D'''],
											    '''latent_channels''': 4,
											}
											SCREAMING_SNAKE_CASE_   	=    self.dummy_input
											return init_dict, inputs_dict


