



"""simple docstring"""




from collections import defaultdict

from graphs.minimum_spanning_tree_prims import prisms_algorithm as mst

def 						__snake_case						(				)  ->       Any:





     '''simple docstring'''

     _UpperCAmelCase      :     List[Any]        =   9, 14  # noqa: F841
     _UpperCAmelCase      :     str        =   [
         [0, 1, 4],
         [0, 7, 8],
         [1, 2, 8],
         [7, 8, 7],
         [7, 6, 1],
         [2, 8, 2],
         [8, 6, 6],
         [2, 3, 7],
         [2, 5, 4],
         [6, 5, 2],
         [3, 5, 14],
         [3, 4, 9],
         [5, 4, 10],
         [1, 7, 11],
     ]

     _UpperCAmelCase      :     List[Any]        =   defaultdict(SCREAMING_SNAKE_CASE__    )
     for nodea, nodea, cost in edges:
          adjancency[nodea].append([nodea, cost]    )
          adjancency[nodea].append([nodea, cost]    )

     _UpperCAmelCase      :     List[Any]        =   mst(SCREAMING_SNAKE_CASE__    )

     _UpperCAmelCase      :     Tuple        =   [
         [7, 6, 1],
         [2, 8, 2],
         [6, 5, 2],
         [0, 1, 4],
         [2, 5, 4],
         [2, 3, 7],
         [0, 7, 8],
         [3, 4, 9],
     ]

     for answer in expected:
          _UpperCAmelCase      :     List[str]        =   tuple(answer[:2]    )
          _UpperCAmelCase      :     int        =   tuple(edge[::-1]    )
          assert edge in result or reverse in result





"""simple docstring"""




def 						__snake_case						(				SCREAMING_SNAKE_CASE__     :						List[str]    )  ->       str:





     '''simple docstring'''

     _UpperCAmelCase    ,	_UpperCAmelCase      :     Dict        =   [], []
     while len(SCREAMING_SNAKE_CASE__    ) > 1:
          _UpperCAmelCase    ,	_UpperCAmelCase      :     int        =   min(SCREAMING_SNAKE_CASE__    ), max(SCREAMING_SNAKE_CASE__    )
          start.append(SCREAMING_SNAKE_CASE__    )
          end.append(SCREAMING_SNAKE_CASE__    )
          collection.remove(SCREAMING_SNAKE_CASE__    )
          collection.remove(SCREAMING_SNAKE_CASE__    )
     end.reverse()
     return start + collection + end


if __name__ == "__main__":
 _lowerCAmelCase    : int							=							input("Enter numbers separated by a comma:\n").strip()
 _lowerCAmelCase    : List[str]							=							[int(item) for item in user_input.split(",")]
 print(*merge_sort(unsorted), sep=",")
