




'''simple docstring'''


import sys
from collections import defaultdict





class  __lowercase    :







   def __init__(						self   )					->     List[str]:
     __a								=       []







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   )					->     Dict:
     return self.node_position[vertex]







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   ,				UpperCamelCase   )					->     Tuple:
     __a								=       pos







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   )					->     Tuple:
     if start > size // 2 - 1:
       return
     else:
       if 2 * start + 2 >= size:
         __a								=       2 * start + 1
       else:
         if heap[2 * start + 1] < heap[2 * start + 2]:
           __a								=       2 * start + 1
         else:
           __a								=       2 * start + 2
       if heap[smallest_child] < heap[start]:
         __a						,							__a								=       heap[smallest_child], positions[smallest_child]
         __a						,							__a								=       (
             heap[start],
             positions[start],
         )
         __a						,							__a								=       temp, tempa

         __a								=       self.get_position(positions[smallest_child]   )
         self.set_position(
             positions[smallest_child]   ,				self.get_position(positions[start]   )   )
         self.set_position(positions[start]   ,				UpperCamelCase   )

         self.top_to_bottom(UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   )







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   )					->     Dict:
     __a								=       position[index]

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

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







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   ,				UpperCamelCase   )					->     int:
     __a								=       len(UpperCamelCase   ) // 2 - 1
     for i in range(UpperCamelCase   ,				-1   ,				-1   ):
       self.top_to_bottom(UpperCamelCase   ,				UpperCamelCase   ,				len(UpperCamelCase   )   ,				UpperCamelCase   )







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   ,				UpperCamelCase   )					->     str:
     __a								=       positions[0]
     __a								=       sys.maxsize
     self.top_to_bottom(UpperCamelCase   ,				0   ,				len(UpperCamelCase   )   ,				UpperCamelCase   )
     return temp


def     SCREAMING_SNAKE_CASE							(   a_						:				str      ):
  __a								=       Heap()

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

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

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

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


if __name__ == "__main__":  # pragma: no cover
  # < --------- Prims Algorithm --------- >
  UpperCAmelCase_					=   int(input("Enter number of edges: ").strip())
  UpperCAmelCase_					=   defaultdict(list)
  for _ in range(edges_number):
    UpperCAmelCase_					=   [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 collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


if TYPE_CHECKING:
  from ... import FeatureExtractionMixin, TensorType

UpperCAmelCase_					=   logging.get_logger(__name__)

UpperCAmelCase_					=   {
    "openai/imagegpt-small": "",
    "openai/imagegpt-medium": "",
    "openai/imagegpt-large": "",
}





class  __lowercase    (	__magic_name__			):
   _a    						=   """imagegpt"""
   _a    						=   ["""past_key_values"""]
   _a    						=   {
       """hidden_size""": """n_embd""",
       """max_position_embeddings""": """n_positions""",
       """num_attention_heads""": """n_head""",
       """num_hidden_layers""": """n_layer""",
   }







   def __init__(						self   ,				UpperCamelCase=512 + 1   ,				UpperCamelCase=32 * 32   ,				UpperCamelCase=512   ,				UpperCamelCase=24   ,				UpperCamelCase=8   ,				UpperCamelCase=None   ,				UpperCamelCase="quick_gelu"   ,				UpperCamelCase=0.1   ,				UpperCamelCase=0.1   ,				UpperCamelCase=0.1   ,				UpperCamelCase=1e-5   ,				UpperCamelCase=0.02   ,				UpperCamelCase=True   ,				UpperCamelCase=True   ,				UpperCamelCase=False   ,				UpperCamelCase=False   ,				UpperCamelCase=False   ,				**UpperCamelCase   ,				)					->     int:
     __a								=       vocab_size
     __a								=       n_positions
     __a								=       n_embd
     __a								=       n_layer
     __a								=       n_head
     __a								=       n_inner
     __a								=       activation_function
     __a								=       resid_pdrop
     __a								=       embd_pdrop
     __a								=       attn_pdrop
     __a								=       layer_norm_epsilon
     __a								=       initializer_range
     __a								=       scale_attn_weights
     __a								=       use_cache
     __a								=       scale_attn_by_inverse_layer_idx
     __a								=       reorder_and_upcast_attn
     __a								=       tie_word_embeddings

     super().__init__(tie_word_embeddings=UpperCamelCase   ,				**UpperCamelCase   )





class  __lowercase    (	__magic_name__			):







   @property
   def 		UpperCamelCase__      (						self   )					->     Mapping[str, Mapping[int, str]]:
     return OrderedDict(
         [
             ('input_ids', {0: 'batch', 1: 'sequence'}),
         ]   )







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   ,				UpperCamelCase = 1   ,				UpperCamelCase = -1   ,				UpperCamelCase = False   ,				UpperCamelCase = None   ,				UpperCamelCase = 3   ,				UpperCamelCase = 32   ,				UpperCamelCase = 32   ,				)					->     Mapping[str, Any]:
     __a								=       self._generate_dummy_images(UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   )
     __a								=       dict(preprocessor(images=UpperCamelCase   ,				return_tensors=UpperCamelCase   )   )

     return inputs



