



from __future__ import annotations

import os
from collections.abc import Mapping

a_  :int     = tuple[int, int]




class    snake_case__		:






     """simple docstring"""


     def __init__(			self    :    int,					_snake_case    :    set[int],					_snake_case    :    Mapping[EdgeT, int]   )  ->None:
            snake_case__				:      Tuple        =      vertices
            snake_case__				:      Optional[Any]        =      {
                (min(_snake_case   ), max(_snake_case   )): weight for edge, weight in edges.items()
            }






     def   lowercase_  (			self    :    Optional[Any],					_snake_case    :    EdgeT,					_snake_case    :    int   )  ->None:
            self.vertices.add(edge[0]   )
            self.vertices.add(edge[1]   )
            snake_case__				:      Union[str, Any]        =      weight






     def   lowercase_  (			self    :    Any   )  ->Graph:
            snake_case__				:      List[Any]        =      Graph({min(self.vertices   )},					{}   )
            snake_case__				:      Dict        =      4_2
            snake_case__				:      Optional[int]        =      4_2
            snake_case__				:      Tuple        =      4_2
            snake_case__				:      Union[str, Any]        =      4_2

            while len(subgraph.vertices   ) < len(self.vertices   ):
                   snake_case__				:      List[str]        =      max(self.edges.values()   ) + 1
                   for edge, weight in self.edges.items():
                          if (edge[0] in subgraph.vertices) ^ (edge[1] in subgraph.vertices):
                                 if weight < min_weight:
                                        snake_case__				:      int        =      edge
                                        snake_case__				:      Optional[Any]        =      weight

                   subgraph.add_edge(_snake_case,					_snake_case   )

            return subgraph


def 			lowercase_				(A					:					Tuple = "p107_network.txt" ):
       snake_case__				:      Optional[int]        =      os.path.abspath(os.path.dirname(__a ) )
       snake_case__				:      Union[str, Any]        =      os.path.join(__a						,   __a )
       snake_case__				:      int        =      {}
       snake_case__				:      Dict        =      4_2
       snake_case__				:      Optional[Any]        =      4_2
       snake_case__				:      Dict        =      4_2

       with open(__a ) as f:
              snake_case__				:      Optional[int]        =      f.read().strip().split('\n' )

       snake_case__				:      Optional[Any]        =      [line.split(',' ) for line in data]

       for edgea in range(1						,   len(__a ) ):
              for edgea in range(__a ):
                     if adjaceny_matrix[edgea][edgea] != "-":
                            snake_case__				:      Optional[int]        =      int(adjaceny_matrix[edgea][edgea] )

       snake_case__				:      int        =      Graph(set(range(len(__a ) ) )						,   __a )

       snake_case__				:      Dict        =      graph.prims_algorithm()

       snake_case__				:      Union[str, Any]        =      sum(graph.edges.values() )
       snake_case__				:      List[Any]        =      sum(subgraph.edges.values() )

       return initial_total - optimal_total


if __name__ == "__main__":
 print(F"""{solution() = }""")








"""simple docstring"""





def 				A_  (__a					):

					'''simple docstring'''





					A_								=    len(__a					)
					while cur > 1:
										# Find the maximum number in arr
										A_								=    arr.index(max(arr[0:cur]					)					)
										# Reverse from 0 to mi
										A_								=    arr[mi::-1] + arr[mi + 1 : len(__a					)]
										# Reverse whole list
										A_								=    arr[cur - 1 :: -1] + arr[cur : len(__a					)]
										cur -= 1
					return arr


if __name__ == "__main__":
		UpperCamelCase_       :    Optional[Any]						      =			input('''Enter numbers separated by a comma:\n''').strip()
		UpperCamelCase_       :    Any						      =			[int(item) for item in user_input.split(''',''')]
		print(pancake_sort(unsorted))




