





import sys
from collections import defaultdict

class 		UpperCamelCase__			:



     '''simple docstring'''

     def __init__(							self						:   Optional[Any]	)					->		Optional[Any]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						[]






     def     SCREAMING_SNAKE_CASE__  (							self						:   int						,lowerCamelCase__						:   List[Any]	)					->		List[str]:




           '''simple docstring'''


           return self.node_position[vertex]






     def     SCREAMING_SNAKE_CASE__  (							self						:   List[str]						,lowerCamelCase__						:   str						,lowerCamelCase__						:   List[str]	)					->		Tuple:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						pos






     def     SCREAMING_SNAKE_CASE__  (							self						:   str						,lowerCamelCase__						:   Any						,lowerCamelCase__						:   Optional[Any]						,lowerCamelCase__						:   Dict						,lowerCamelCase__						:   List[str]	)					->		Union[str, Any]:




           '''simple docstring'''


           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]						,snake_case_	)

                       self.top_to_bottom(snake_case_						,snake_case_						,snake_case_						,snake_case_	)






     def     SCREAMING_SNAKE_CASE__  (							self						:   Optional[Any]						,lowerCamelCase__						:   str						,lowerCamelCase__						:   Optional[int]						,lowerCamelCase__						:   int						,lowerCamelCase__						:   int	)					->		Optional[int]:




           '''simple docstring'''


           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]						,snake_case_	)
                 else:
                       SCREAMING_SNAKE_CASE		=						val
                       SCREAMING_SNAKE_CASE		=						temp
                       self.set_position(snake_case_						,snake_case_	)
                       break
                 SCREAMING_SNAKE_CASE		=						parent
           else:
                 SCREAMING_SNAKE_CASE		=						val
                 SCREAMING_SNAKE_CASE		=						temp
                 self.set_position(snake_case_						,0	)






     def     SCREAMING_SNAKE_CASE__  (							self						:   int						,lowerCamelCase__						:   Union[str, Any]						,lowerCamelCase__						:   Optional[int]	)					->		List[str]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						len(snake_case_	) // 2 - 1
           for i in range(snake_case_						,-1						,-1	):
                 self.top_to_bottom(snake_case_						,snake_case_						,len(snake_case_	)						,snake_case_	)






     def     SCREAMING_SNAKE_CASE__  (							self						:   Tuple						,lowerCamelCase__						:   int						,lowerCamelCase__						:   List[str]	)					->		List[Any]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						positions[0]
           SCREAMING_SNAKE_CASE		=						sys.maxsize
           self.top_to_bottom(snake_case_						,0						,len(snake_case_	)						,snake_case_	)
           return temp



def        __lowercase       (				_SCREAMING_SNAKE_CASE     )			->       Tuple:


      '''simple docstring'''


      SCREAMING_SNAKE_CASE		=						Heap()

      SCREAMING_SNAKE_CASE		=						[0] * len(lowerCAmelCase__     )
      SCREAMING_SNAKE_CASE		=						[-1] * len(lowerCAmelCase__     )  # 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(lowerCAmelCase__     )     ):
            distance_tv.append(sys.maxsize     )
            positions.append(lowerCAmelCase__     )
            heap.node_position.append(lowerCAmelCase__     )

      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(lowerCAmelCase__			,						lowerCAmelCase__     )

      for _ in range(1			,						len(lowerCAmelCase__     )     ):
            SCREAMING_SNAKE_CASE		=						heap.delete_minimum(lowerCAmelCase__			,						lowerCAmelCase__     )
            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(lowerCAmelCase__     )]
                        ):
                              SCREAMING_SNAKE_CASE		=						distance
                              heap.bottom_to_top(
                                  lowerCAmelCase__			,						heap.get_position(lowerCAmelCase__     )			,						lowerCAmelCase__			,						lowerCAmelCase__     )
                              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))













from __future__ import annotations

import math



def        __lowercase       (				_SCREAMING_SNAKE_CASE     )			->       bool:


      '''simple docstring'''


      if 1 < number < 4:
            # 2 and 3 are primes
            return True
      elif number < 2 or number % 2 == 0 or number % 3 == 0:
            # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
            return False

      # All primes number are in format of 6k +/- 1
      for i in range(5			,						int(math.sqrt(_SCREAMING_SNAKE_CASE     ) + 1     )			,						6     ):
            if number % i == 0 or number % (i + 2) == 0:
                  return False
      return True



def        __lowercase       (				_SCREAMING_SNAKE_CASE     )			->       list[int]:


      '''simple docstring'''


      SCREAMING_SNAKE_CASE		=						str(_SCREAMING_SNAKE_CASE     )
      SCREAMING_SNAKE_CASE		=						[n]
      for i in range(1			,						len(_SCREAMING_SNAKE_CASE     )     ):
            list_nums.append(int(str_num[i:]     )     )
            list_nums.append(int(str_num[:-i]     )     )
      return list_nums



def        __lowercase       (				_SCREAMING_SNAKE_CASE     )			->       bool:


      '''simple docstring'''


      if len(str(_SCREAMING_SNAKE_CASE     )     ) > 3:
            if not is_prime(int(str(_SCREAMING_SNAKE_CASE     )[-3:]     )     ) or not is_prime(int(str(_SCREAMING_SNAKE_CASE     )[:3]     )     ):
                  return False
      return True



def        __lowercase       (				_SCREAMING_SNAKE_CASE = 11     )			->       list[int]:


      '''simple docstring'''


      SCREAMING_SNAKE_CASE		=						[]
      SCREAMING_SNAKE_CASE		=						13
      while len(_SCREAMING_SNAKE_CASE     ) != count:
            if validate(_SCREAMING_SNAKE_CASE     ):
                  SCREAMING_SNAKE_CASE		=						list_truncated_nums(_SCREAMING_SNAKE_CASE     )
                  if all(is_prime(_SCREAMING_SNAKE_CASE     ) for i in list_nums     ):
                        list_truncated_primes.append(_SCREAMING_SNAKE_CASE     )
            num += 2
      return list_truncated_primes



def        __lowercase       (				)			->       int:


      '''simple docstring'''


      return sum(compute_truncated_primes(11     )     )


if __name__ == "__main__":
      print(F'''{sum(compute_truncated_primes(1_1)) = }''')


