






from __future__ import annotations

from bisect import bisect_left
from functools import total_ordering
from heapq import merge
@total_ordering
class 				A_     (    SCREAMING_SNAKE_CASE__      ):






 '''simple docstring'''




 def __lt__(						self				,	_A)			->		Union[str, Any]:

     """simple docstring"""



     return self[-1] < other[-1]


 def __eq__(						self				,	_A)			->		Any:

     """simple docstring"""



     return self[-1] == other[-1]



def   _lowerCamelCase						(    __A     :				Union[str, Any]			)   ->       Union[str, Any]:
    _UpperCAmelCase					:   list[Stack]      	=					[]
    # sort into stacks
    for element in collection:
        _UpperCAmelCase					:   int      	=					Stack([element]			)
        _UpperCAmelCase					:   str      	=					bisect_left(_UpperCamelCase		,		_UpperCamelCase			)
        if i != len(_UpperCamelCase			):
            stacks[i].append(_UpperCamelCase			)
        else:
            stacks.append(_UpperCamelCase			)

        # use a heap-based merge to merge stack efficiently
    _UpperCAmelCase					:   Any      	=					merge(*(reversed(_UpperCamelCase			) for stack in stacks)			)
    return collection


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






"""simple docstring"""




from collections.abc import Callable




def 			_lowerCAmelCase		(		_UpperCamelCase			,					_UpperCamelCase			,					_UpperCamelCase    ):






  """simple docstring"""



  _lowercase:      float   			=  a
  _lowercase:      float   			=  b
  if function(_UpperCamelCase    ) == 0:  # one of the a or b is a root for the function
    return a
  elif function(_UpperCamelCase    ) == 0:
    return b
  elif (
      function(_UpperCamelCase    ) * function(_UpperCamelCase    ) > 0
  ):  # if none of these are root and they are both positive or negative,
    # then this algorithm can't find the root
    raise ValueError('''could not find root in given interval.'''    )
  else:
    _lowercase:      float   			=  start + (end - start) / 2.0
    while abs(start - mid    ) > 10**-7:  # until precisely equals to 10^-7
      if function(_UpperCamelCase    ) == 0:
        return mid
      elif function(_UpperCamelCase    ) * function(_UpperCamelCase    ) < 0:
        _lowercase:      Union[str, Any]   			=  mid
      else:
        _lowercase:      Any   			=  mid
      _lowercase:      List[Any]   			=  start + (end - start) / 2.0
    return mid




def 			_lowerCAmelCase		(		_UpperCamelCase    ):






  """simple docstring"""



  return x**3 - 2 * x - 5


if __name__ == "__main__":
  print(bisection(f, 1, 1_0_0_0))

  import doctest

  doctest.testmod()
