"""simple docstring"""


import sys
from collections import defaultdict




class  UpperCamelCase					:







       def __init__( self)      ->      Optional[int]:
            snake_case_					       =					[]







       def 		a_						( self,							lowerCAmelCase__)      ->      Any:
            return self.node_position[vertex]







       def 		a_						( self,							lowerCAmelCase__,							lowerCAmelCase__)      ->      Dict:
            snake_case_					       =					pos







       def 		a_						( self,							lowerCAmelCase__,							lowerCAmelCase__,							lowerCAmelCase__,							lowerCAmelCase__)      ->      str:
            if start > size // 2 - 1:
                 return
            else:
                 if 2 * start + 2 >= size:
                      snake_case_					       =					2 * start + 1
                 else:
                      if heap[2 * start + 1] < heap[2 * start + 2]:
                           snake_case_					       =					2 * start + 1
                      else:
                           snake_case_					       =					2 * start + 2
                 if heap[smallest_child] < heap[start]:
                      snake_case_       ,	snake_case_					       =					heap[smallest_child], positions[smallest_child]
                      snake_case_       ,	snake_case_					       =					(
                          heap[start],
                          positions[start],
                      )
                      snake_case_       ,	snake_case_					       =					temp, tempa

                      snake_case_					       =					self.get_position(positions[smallest_child])
                      self.set_position(
                          positions[smallest_child],							self.get_position(positions[start]))
                      self.set_position(positions[start],							lowerCAmelCase__)

                      self.top_to_bottom(lowerCAmelCase__,							lowerCAmelCase__,							lowerCAmelCase__,							lowerCAmelCase__)







       def 		a_						( self,							lowerCAmelCase__,							lowerCAmelCase__,							lowerCAmelCase__,							lowerCAmelCase__)      ->      List[str]:
            snake_case_					       =					position[index]

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

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







       def 		a_						( self,							lowerCAmelCase__,							lowerCAmelCase__)      ->      Dict:
            snake_case_					       =					len(lowerCAmelCase__) // 2 - 1
            for i in range(lowerCAmelCase__,							-1,							-1):
                 self.top_to_bottom(lowerCAmelCase__,							lowerCAmelCase__,							len(lowerCAmelCase__),							lowerCAmelCase__)







       def 		a_						( self,							lowerCAmelCase__,							lowerCAmelCase__)      ->      Union[str, Any]:
            snake_case_					       =					positions[0]
            snake_case_					       =					sys.maxsize
            self.top_to_bottom(lowerCAmelCase__,							0,							len(lowerCAmelCase__),							lowerCAmelCase__)
            return temp







def 					UpperCAmelCase    (		UpperCAmelCase					)				->      Tuple:
     snake_case_					       =					Heap()

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

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

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

     for _ in range(1						,					len(UpperCAmelCase					)					):
          snake_case_					       =					heap.delete_minimum(UpperCAmelCase						,					UpperCAmelCase					)
          if visited[vertex] == 0:
               tree_edges.append((nbr_tv[vertex], vertex)					)
               snake_case_					       =					1
               for neighbor, distance in adjacency_list[vertex]:
                    if (
                        visited[neighbor] == 0
                        and distance < distance_tv[heap.get_position(UpperCAmelCase					)]
                    ):
                         snake_case_					       =					distance
                         heap.bottom_to_top(
                             UpperCAmelCase						,					heap.get_position(UpperCAmelCase					)						,					UpperCAmelCase						,					UpperCAmelCase					)
                         snake_case_					       =					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"""




import os
import zipfile

import requests
from get_ci_error_statistics import download_artifact, get_artifacts_links


def   __magic_name__	(      __snake_case				:       Union[str, Any]     , __snake_case				:       List[str]=7  ) ->				str:
       lowercase    :				int       		=							None
       if token is not None:
              lowercase    :				Any       		=							{"Accept": "application/vnd.github+json", "Authorization": f"""Bearer {token}"""}

       # The id of a workflow (not of a workflow run)
       lowercase    :				int       		=							"636036"

       lowercase    :				Dict       		=							f"""https://api.github.com/repos/huggingface/transformers/actions/workflows/{workflow_id}/runs"""
       # On `main` branch + event being `schedule` + not returning PRs + only `num_runs` results
       url += f"""?branch=main&event=schedule&exclude_pull_requests=true&per_page={num_runs}"""

       lowercase    :				int       		=							requests.get(__snake_case     , headers=__snake_case  ).json()

       return result["workflow_runs"]


def   __magic_name__	(      __snake_case				:       Dict  ) ->				Tuple:
       lowercase    :				Tuple       		=							get_daily_ci_runs(__snake_case  )
       lowercase    :				Union[str, Any]       		=							None
       for workflow_run in workflow_runs:
              if workflow_run["status"] == "completed":
                     lowercase    :				List[Any]       		=							workflow_run["id"]
                     break

       return workflow_run_id


def   __magic_name__	(      __snake_case				:       Optional[int]     , __snake_case				:       Optional[Any]     , __snake_case				:       Union[str, Any]  ) ->				int:
       lowercase    :				Dict       		=							get_last_daily_ci_runs(__snake_case  )
       if workflow_run_id is not None:
              lowercase    :				Dict       		=							get_artifacts_links(worflow_run_id=__snake_case     , token=__snake_case  )
              for artifact_name in artifact_names:
                     if artifact_name in artifacts_links:
                            lowercase    :				Optional[int]       		=							artifacts_links[artifact_name]
                            download_artifact(
                                artifact_name=__snake_case     , artifact_url=__snake_case     , output_dir=__snake_case     , token=__snake_case  )


def   __magic_name__	(      __snake_case				:       List[Any]     , __snake_case				:       Optional[int]     , __snake_case				:       Tuple  ) ->				Optional[int]:
       get_last_daily_ci_artifacts(__snake_case     , __snake_case     , __snake_case  )

       lowercase    :				str       		=							{}
       for artifact_name in artifact_names:
              lowercase    :				Optional[Any]       		=							os.path.join(__snake_case     , f"""{artifact_name}.zip"""  )
              if os.path.isfile(__snake_case  ):
                     lowercase    :				List[Any]       		=							{}
                     with zipfile.ZipFile(__snake_case  ) as z:
                            for filename in z.namelist():
                                   if not os.path.isdir(__snake_case  ):
                                          # read the file
                                          with z.open(__snake_case  ) as f:
                                                 lowercase    :				str       		=							f.read().decode("UTF-8"  )

       return results


