




def 			lowerCAmelCase_			(  lowerCamelCase:       int						)					->			int:


      '''simple docstring'''




      barcode //= 10  # exclude the last digit
      lowerCamelCase__        =				False
      lowerCamelCase__        =				0

      # extract and check each digit
      while barcode != 0:
            lowerCamelCase__        =				1 if checker else 3
            s += mult * (barcode % 10)
            barcode //= 10
            lowerCamelCase__        =				not checker

      return (10 - (s % 10)) % 10

def 			lowerCAmelCase_			(  lowerCamelCase:       int						)					->			bool:


      '''simple docstring'''




      return len(str(lowerCamelCase						)						) == 13 and get_check_digit(lowerCamelCase						) == barcode % 10

def 			lowerCAmelCase_			(  lowerCamelCase:       str						)					->			int:


      '''simple docstring'''




      if str(lowerCamelCase						).isalpha():
            lowerCamelCase__        =				f"""Barcode '{barcode}' has alphabetic characters."""
            raise ValueError(lowerCamelCase						)
      elif int(lowerCamelCase						) < 0:
            raise ValueError('The entered barcode has a negative value. Try again.'						)
      else:
            return int(lowerCamelCase						)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      __SCREAMING_SNAKE_CASE    :   Optional[Any]       =get_barcode(input("""Barcode: """).strip())

      if is_valid(barcode):
            print(F"""'{barcode}' is a valid barcode.""")
      else:
            print(F"""'{barcode}' is NOT a valid barcode.""")





def 			lowerCAmelCase_			(  lowerCamelCase:       int     ,				lowerCamelCase:       list[tuple[int, int, int]]						)					->			list[tuple[int, int, int]]:


      '''simple docstring'''




      lowerCamelCase__        =				sorted(lowerCamelCase     ,				key=lambda lowerCamelCase						: edge[2]						)

      lowerCamelCase__        =				list(range(lowerCamelCase						)						)

      def find_parent(lowerCamelCase:       int						):
            if i != parent[i]:
                  lowerCamelCase__        =				find_parent(parent[i]						)
            return parent[i]

      lowerCamelCase__        =				0
      lowerCamelCase__        =				[]

      for edge in edges:
            lowerCamelCase__        =				find_parent(edge[0]						)
            lowerCamelCase__        =				find_parent(edge[1]						)
            if parent_a != parent_b:
                  minimum_spanning_tree_cost += edge[2]
                  minimum_spanning_tree.append(lowerCamelCase						)
                  lowerCamelCase__        =				parent_b

      return minimum_spanning_tree


if __name__ == "__main__":  # pragma: no cover
      __SCREAMING_SNAKE_CASE    ,  __SCREAMING_SNAKE_CASE    :   Tuple       =list(map(int, input().strip().split()))
      __SCREAMING_SNAKE_CASE    :   Optional[Any]       =[]

      for _ in range(num_edges):
            __SCREAMING_SNAKE_CASE    ,  __SCREAMING_SNAKE_CASE    ,  __SCREAMING_SNAKE_CASE    :   Optional[int]       =(int(x) for x in input().strip().split())
            edges.append((nodea, nodea, cost))

      kruskal(num_nodes, edges)