





def     a_       (					lowerCAmelCase_ :     List[str]      ):



   for i in range(len(__A      ) - 1,      0,      -1      ):
      __lowerCAmelCase				      =      False

      for j in range(__A,      0,      -1      ):
         if unsorted[j] < unsorted[j - 1]:
            __lowerCAmelCase      ,      __lowerCAmelCase				      =      unsorted[j - 1], unsorted[j]
            __lowerCAmelCase				      =      True

      for j in range(__A      ):
         if unsorted[j] > unsorted[j + 1]:
            __lowerCAmelCase      ,      __lowerCAmelCase				      =      unsorted[j + 1], unsorted[j]
            __lowerCAmelCase				      =      True

      if not swapped:
         break
   return unsorted


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     _snake_case    :       str		       =    input('Enter numbers separated by a comma:\n').strip()
     _snake_case    :       Optional[int]		       =    [int(item) for item in user_input.split(',')]
     print(F"""{cocktail_shaker_sort(unsorted) = }""")






'''simple docstring'''





def lowerCAmelCase    (__A):



     """simple docstring"""



     if not isinstance(__A    ,      __A):
          raise ValueError('''multiplicative_persistence() only accepts integral values''')
     if num < 0:
          raise ValueError('''multiplicative_persistence() does not accept negative values''')

     _a           =    0
     _a           =    str(__A)

     while len(__A) != 1:
          _a           =    [int(__A) for i in num_string]

          _a           =    1
          for i in range(0    ,      len(__A)):
               total *= numbers[i]

          _a           =    str(__A)

          steps += 1
     return steps




def lowerCAmelCase    (__A):



     """simple docstring"""



     if not isinstance(__A    ,      __A):
          raise ValueError('''additive_persistence() only accepts integral values''')
     if num < 0:
          raise ValueError('''additive_persistence() does not accept negative values''')

     _a           =    0
     _a           =    str(__A)

     while len(__A) != 1:
          _a           =    [int(__A) for i in num_string]

          _a           =    0
          for i in range(0    ,      len(__A)):
               total += numbers[i]

          _a           =    str(__A)

          steps += 1
     return steps


if __name__ == "__main__":
  import doctest

  doctest.testmod()



