





from __future__ import annotations

from collections.abc import Iterator
from typing import Any





class A_   :




   def __init__(self      :int       ,  _UpperCamelCase      :Any					)->   None:
         __A			  =							data
         __A			  =							None






   def __str__(self      :Optional[int]					)->   str:
         return f"""{self.data}"""





class A_   :




   def __init__(self      :Optional[Any]					)->   None:
         __A			  =							None
         __A			  =							None




   def __iter__(self      :Optional[int]					)->   Iterator[Any]:
         __A			  =							self.front
         while node:
               yield node.data
               __A			  =							node.next




   def __len__(self      :Dict					)->   int:
         return len(tuple(iter(self					)					)					)




   def __str__(self      :str					)->   str:
         return " <- ".join(str(_UpperCamelCase					) for item in self					)




   def _lowerCAmelCase (self      :Optional[int]					)->   bool:
         return len(self					) == 0




   def _lowerCAmelCase (self      :Optional[Any]       ,  _UpperCamelCase      :Any					)->   None:
         __A			  =							Node(_UpperCamelCase					)
         if self.is_empty():
               __A			  =							__A			  =							node
         else:
               assert isinstance(self.rear       ,  _UpperCamelCase					)
               __A			  =							node
               __A			  =							node




   def _lowerCAmelCase (self      :List[str]					)->   Any:
         if self.is_empty():
               raise IndexError('''dequeue from empty queue'''					)
         assert isinstance(self.front       ,  _UpperCamelCase					)
         __A			  =							self.front
         __A			  =							self.front.next
         if self.front is None:
               __A			  =							None
         return node.data






   def _lowerCAmelCase (self      :int					)->   None:
         __A			  =							__A			  =							None


if __name__ == "__main__":
       from doctest import testmod

       testmod()












def _a							(      lowerCamelCase:  list					)      ->		list:







      '''simple docstring'''






      __A			  =							len(lowerCamelCase					)
      for cycle_start in range(0   ,							array_len - 1					):
            __A			  =							array[cycle_start]

            __A			  =							cycle_start
            for i in range(cycle_start + 1   ,							lowerCamelCase					):
                  if array[i] < item:
                        pos += 1

            if pos == cycle_start:
                  continue

            while item == array[pos]:
                  pos += 1

            __A  ,		__A			  =							item, array[pos]
            while pos != cycle_start:
                  __A			  =							cycle_start
                  for i in range(cycle_start + 1   ,							lowerCamelCase					):
                        if array[i] < item:
                              pos += 1

                  while item == array[pos]:
                        pos += 1

                  __A  ,		__A			  =							item, array[pos]

      return array


if __name__ == "__main__":
       assert cycle_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
       assert cycle_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]





