


"""simple docstring"""







import sys
from collections import defaultdict






class 						_A  :







    """simple docstring"""




    def __init__( self    :   Optional[Any]):
      a						:		Tuple											=      []






    def      __snake_case							( self    :   Optional[Any]    ,			__UpperCAmelCase    :   str):
      return self.node_position[vertex]






    def      __snake_case							( self    :   Tuple    ,			__UpperCAmelCase    :   str    ,			__UpperCAmelCase    :   Dict):
      a						:		int											=      pos






    def      __snake_case							( self    :   int    ,			__UpperCAmelCase    :   int    ,			__UpperCAmelCase    :   List[str]    ,			__UpperCAmelCase    :   Optional[int]    ,			__UpperCAmelCase    :   Optional[int]):
      if start > size // 2 - 1:
        return
      else:
        if 2 * start + 2 >= size:
          a						:		List[str]											=      2 * start + 1
        else:
          if heap[2 * start + 1] < heap[2 * start + 2]:
            a						:		List[Any]											=      2 * start + 1
          else:
            a						:		int											=      2 * start + 2
        if heap[smallest_child] < heap[start]:
          a							,		a						:		Optional[Any]											=      heap[smallest_child], positions[smallest_child]
          a							,		a						:		Union[str, Any]											=      (
              heap[start],
              positions[start],
          )
          a							,		a						:		Tuple											=      temp, tempa

          a						:		Optional[int]											=      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      __snake_case							( self    :   Tuple    ,			__UpperCAmelCase    :   str    ,			__UpperCAmelCase    :   List[Any]    ,			__UpperCAmelCase    :   Optional[int]    ,			__UpperCAmelCase    :   Optional[Any]):
      a						:		Tuple											=      position[index]

      while index != 0:
        a						:		List[Any]											=      int((index - 2) / 2) if index % 2 == 0 else int((index - 1) / 2)

        if val < heap[parent]:
          a						:		Optional[Any]											=      heap[parent]
          a						:		int											=      position[parent]
          self.set_position(position[parent]    ,			_a)
        else:
          a						:		List[Any]											=      val
          a						:		Any											=      temp
          self.set_position(_a    ,			_a)
          break
        a						:		Optional[int]											=      parent
      else:
        a						:		List[Any]											=      val
        a						:		Any											=      temp
        self.set_position(_a    ,			0)






    def      __snake_case							( self    :   Union[str, Any]    ,			__UpperCAmelCase    :   List[str]    ,			__UpperCAmelCase    :   Union[str, Any]):
      a						:		int											=      len(_a) // 2 - 1
      for i in range(_a    ,			-1    ,			-1):
        self.top_to_bottom(_a    ,			_a    ,			len(_a)    ,			_a)






    def      __snake_case							( self    :   List[Any]    ,			__UpperCAmelCase    :   Any    ,			__UpperCAmelCase    :   Dict):
      a						:		Dict											=      positions[0]
      a						:		Optional[int]											=      sys.maxsize
      self.top_to_bottom(_a    ,			0    ,			len(_a)    ,			_a)
      return temp






def 					lowercase      (    A_	)->				Dict:
  '''simple docstring'''







  a						:		Any											=      Heap()

  a						:		Optional[int]											=      [0] * len(lowerCAmelCase__	)
  a						:		List[Any]											=      [-1] * len(lowerCAmelCase__	)  # Neighboring Tree Vertex of selected vertex
  # Minimum Distance of explored vertex with neighboring vertex of partial tree
  # formed in graph
  a						:		List[Any]											=      []  # Heap of Distance of vertices from their neighboring vertex
  a						:		Optional[Any]											=      []

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

  a						:		int											=      []
  a						:		List[Any]											=      1
  a						:		Any											=      sys.maxsize
  for neighbor, distance in adjacency_list[0]:
    a						:		int											=      0
    a						:		List[str]											=      distance
  heap.heapify(lowerCAmelCase__  ,       lowerCAmelCase__	)

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


if __name__ == "__main__":  # pragma: no cover
 # < --------- Prims Algorithm --------- >
 __lowercase    =				int(input("""Enter number of edges: """).strip())
 __lowercase    =				defaultdict(list)
 for _ in range(edges_number):
  __lowercase    =				[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))










"""simple docstring"""







from ...configuration_utils import PretrainedConfig
from ...utils import logging


__lowercase    =				logging.get_logger(__name__)

__lowercase    =				{
    """EleutherAI/gpt-neox-20b""": """https://huggingface.co/EleutherAI/gpt-neox-20b/resolve/main/config.json""",
    # See all GPTNeoX models at https://huggingface.co/models?filter=gpt_neox
}






class 						_A  (  _a  ):







    """simple docstring"""




    UpperCAmelCase	:							Union[str, Any]     =	"""gpt_neox"""






    def __init__( self    :   List[str]    ,			__UpperCAmelCase    :   Tuple=50432    ,			__UpperCAmelCase    :   str=6144    ,			__UpperCAmelCase    :   Any=44    ,			__UpperCAmelCase    :   Union[str, Any]=64    ,			__UpperCAmelCase    :   Dict=24576    ,			__UpperCAmelCase    :   Any="gelu"    ,			__UpperCAmelCase    :   List[Any]=0.25    ,			__UpperCAmelCase    :   Optional[Any]=10000    ,			__UpperCAmelCase    :   Tuple=0.0    ,			__UpperCAmelCase    :   Union[str, Any]=0.0    ,			__UpperCAmelCase    :   Optional[int]=0.1    ,			__UpperCAmelCase    :   List[Any]=2048    ,			__UpperCAmelCase    :   Optional[Any]=0.02    ,			__UpperCAmelCase    :   Optional[Any]=1e-5    ,			__UpperCAmelCase    :   Dict=True    ,			__UpperCAmelCase    :   Union[str, Any]=0    ,			__UpperCAmelCase    :   Union[str, Any]=2    ,			__UpperCAmelCase    :   Any=False    ,			__UpperCAmelCase    :   List[Any]=True    ,			__UpperCAmelCase    :   int=None    ,			**__UpperCAmelCase    :   Tuple    ,			):
      super().__init__(bos_token_id=__UpperCAmelCase    ,			eos_token_id=__UpperCAmelCase    ,			**__UpperCAmelCase)
      a						:		List[Any]											=      vocab_size
      a						:		Optional[int]											=      max_position_embeddings
      a						:		List[Any]											=      hidden_size
      a						:		Union[str, Any]											=      num_hidden_layers
      a						:		int											=      num_attention_heads
      a						:		Union[str, Any]											=      intermediate_size
      a						:		Optional[Any]											=      hidden_act
      a						:		Dict											=      rotary_pct
      a						:		Any											=      rotary_emb_base
      a						:		Dict											=      attention_dropout
      a						:		List[str]											=      hidden_dropout
      a						:		List[str]											=      classifier_dropout
      a						:		Any											=      initializer_range
      a						:		Union[str, Any]											=      layer_norm_eps
      a						:		int											=      use_cache
      a						:		int											=      tie_word_embeddings
      a						:		str											=      use_parallel_residual
      a						:		Union[str, Any]											=      rope_scaling
      self._rope_scaling_validation()

      if self.hidden_size % self.num_attention_heads != 0:
        raise ValueError(
            "The hidden size is not divisble by the number of attention heads! Make sure to update them!")






    def      __snake_case							( self    :   Any):
      if self.rope_scaling is None:
        return

      if not isinstance(self.rope_scaling    ,			__UpperCAmelCase) or len(self.rope_scaling) != 2:
        raise ValueError(
            "`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, "
            f'''got {self.rope_scaling}''')
      a						:		str											=      self.rope_scaling.get("type"    ,			__UpperCAmelCase)
      a						:		List[str]											=      self.rope_scaling.get("factor"    ,			__UpperCAmelCase)
      if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
        raise ValueError(
            f'''`rope_scaling`\'s name field must be one of [\'linear\', \'dynamic\'], got {rope_scaling_type}''')
      if rope_scaling_factor is None or not isinstance(__UpperCAmelCase    ,			__UpperCAmelCase) or rope_scaling_factor <= 1.0:
        raise ValueError(f'''`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}''')






