





from __future__ import annotations

from collections.abc import Iterable, Iterator
from dataclasses import dataclass

a__      :     str         =		(3, 9, -11, 0, 7, 5, 1, -1)
a__      :     Optional[Any]         =		(4, 6, 2, 0, 8, 10, 3, -2)





@dataclass
class UpperCAmelCase_				:
  __lowerCAmelCase   :						int
  __lowerCAmelCase   :						Node | None





class UpperCAmelCase_				:


  def __init__(							self ,__snake_case ):



       """simple docstring"""





       A_          =       None
       for i in sorted(__snake_case ,reverse=__snake_case ):
            A_          =       Node(__snake_case ,self.head )


  def __iter__(							self ):



       """simple docstring"""





       A_          =       self.head
       while node:
            yield node.data
            A_          =       node.next_node


  def __len__(							self ):



       """simple docstring"""





       return sum(1 for _ in self )




  def __str__(							self ):



       """simple docstring"""





       return " -> ".join([str(__snake_case ) for node in self] )




def      UpperCAmelCase_    (    _UpperCAmelCase							:SortedLinkedList  ,						_UpperCAmelCase							:SortedLinkedList				)	->				SortedLinkedList:
     '''simple docstring'''


     return SortedLinkedList(list(_UpperCAmelCase				) + list(_UpperCAmelCase				)				)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      a__      :     List[Any]         =		SortedLinkedList
      print(merge_lists(SSL(test_data_odd), SSL(test_data_even)))










def      UpperCAmelCase_    (    _UpperCAmelCase							:list				)	->				list:
     '''simple docstring'''


     if len(_UpperCAmelCase				) < 2:
          return collection

     def circle_sort_util(_UpperCAmelCase							:list  ,						_UpperCAmelCase							:int  ,						_UpperCAmelCase							:int				) -> bool:
          A_          =       False

          if low == high:
               return swapped

          A_          =       low
          A_          =       high

          while left < right:
               if collection[left] > collection[right]:
                    A_   ,    A_          =       (
                        collection[right],
                        collection[left],
                    )
                    A_          =       True

               left += 1
               right -= 1

          if left == right and collection[left] > collection[right + 1]:
               A_   ,    A_          =       (
                   collection[right + 1],
                   collection[left],
               )

               A_          =       True

          A_          =       low + int((high - low) / 2				)
          A_          =       circle_sort_util(_UpperCAmelCase  ,						_UpperCAmelCase  ,						_UpperCAmelCase				)
          A_          =       circle_sort_util(_UpperCAmelCase  ,						mid + 1  ,						_UpperCAmelCase				)

          return swapped or left_swap or right_swap

     A_          =       True

     while is_not_sorted is True:
          A_          =       circle_sort_util(_UpperCAmelCase  ,						0  ,						len(_UpperCAmelCase				) - 1				)

     return collection


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



