

from __future__ import annotations





def       snake_case_ (__A	:		list   ,  __A	:		int   ,  __A	:		int   ,  __A	:		int	)     ->      List[Any]:
   __lowerCAmelCase    :     List[Any]          =		[]
   __lowerCAmelCase       ,__lowerCAmelCase    :     Any          =		input_list[low:mid], input_list[mid : high + 1]
   while left and right:
      result.append((left if left[0] <= right[0] else right).pop(0	)	)
   __lowerCAmelCase    :     Optional[int]          =		result + left + right
   return input_list





def       snake_case_ (__A	:		list	)     ->      List[Any]:
   if len(_UpperCAmelCase	) <= 1:
      return input_list
   __lowerCAmelCase    :     List[Any]          =		list(_UpperCAmelCase	)

   # iteration for two-way merging
   __lowerCAmelCase    :     Union[str, Any]          =		2
   while p <= len(_UpperCAmelCase	):
      # getting low, high and middle value for merge-sort of single list
      for i in range(0   ,  len(_UpperCAmelCase	)   ,  _UpperCAmelCase	):
         __lowerCAmelCase    :     Optional[Any]          =		i
         __lowerCAmelCase    :     Optional[int]          =		i + p - 1
         __lowerCAmelCase    :     int          =		(low + high + 1) // 2
         __lowerCAmelCase    :     Tuple          =		merge(_UpperCAmelCase   ,  _UpperCAmelCase   ,  _UpperCAmelCase   ,  _UpperCAmelCase	)
      # final merge of last two parts
      if p * 2 >= len(_UpperCAmelCase	):
         __lowerCAmelCase    :     str          =		i
         __lowerCAmelCase    :     Optional[Any]          =		merge(_UpperCAmelCase   ,  0   ,  _UpperCAmelCase   ,  len(_UpperCAmelCase	) - 1	)
         break
      p *= 2

   return input_list


if __name__ == "__main__":
   __UpperCAmelCase						=					input("""Enter numbers separated by a comma:\n""").strip()
   if user_input == "":
      __UpperCAmelCase						=					[]
   else:
      __UpperCAmelCase						=					[int(item.strip()) for item in user_input.split(""",""")]
   print(iter_merge_sort(unsorted))









"""simple docstring"""
from __future__ import annotations

import os
from collections.abc import Mapping

__UpperCamelCase     :						Optional[Any]						       =  tuple[int, int]







class       a							:



 def __init__(     self				,       _snake_case				,       _snake_case     ):







  """simple docstring"""






  lowerCAmelCase    				= vertices
  lowerCAmelCase    				= {
      (min(_snake_case     ), max(_snake_case     )): weight for edge, weight in edges.items()
  }



 def    UpperCamelCase__  (     self				,       _snake_case				,       _snake_case     ):







  """simple docstring"""






  self.vertices.add(edge[0]     )
  self.vertices.add(edge[1]     )
  lowerCAmelCase    				= weight



 def    UpperCamelCase__  (     self     ):







  """simple docstring"""






  lowerCAmelCase    				= Graph({min(self.vertices     )}				,       {}     )
  lowerCAmelCase    				= 42
  lowerCAmelCase    				= 42
  lowerCAmelCase    				= 42
  lowerCAmelCase    				= 42

  while len(subgraph.vertices     ) < len(self.vertices     ):
   lowerCAmelCase    				= 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:
      lowerCAmelCase    				= edge
      lowerCAmelCase    				= weight

   subgraph.add_edge(_snake_case				,       _snake_case     )

  return subgraph


def 		_SCREAMING_SNAKE_CASE			(_UpperCAmelCase					:    str = "p107_network.txt"			):
 lowerCAmelCase    				= os.path.abspath(os.path.dirname(_UpperCAmelCase			)			)
 lowerCAmelCase    				= os.path.join(_UpperCAmelCase  ,     _UpperCAmelCase			)
 lowerCAmelCase    				= {}
 lowerCAmelCase    				= 42
 lowerCAmelCase    				= 42
 lowerCAmelCase    				= 42

 with open(_UpperCAmelCase			) as f:
  lowerCAmelCase    				= f.read().strip().split('\n'			)

 lowerCAmelCase    				= [line.split(','			) for line in data]

 for edgea in range(1  ,     len(_UpperCAmelCase			)			):
  for edgea in range(_UpperCAmelCase			):
   if adjaceny_matrix[edgea][edgea] != "-":
    lowerCAmelCase    				= int(adjaceny_matrix[edgea][edgea]			)

 lowerCAmelCase    				= Graph(set(range(len(_UpperCAmelCase			)			)			)  ,     _UpperCAmelCase			)

 lowerCAmelCase    				= graph.prims_algorithm()

 lowerCAmelCase    				= sum(graph.edges.values()			)
 lowerCAmelCase    				= sum(subgraph.edges.values()			)

 return initial_total - optimal_total


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





