





from sympy import diff, lambdify, symbols
from sympy.functions import *  # noqa: F403





def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE = "x"							,     _SCREAMING_SNAKE_CASE = 10**-10							,     _SCREAMING_SNAKE_CASE = 1							,     )							-> complex:




    """simple docstring"""




    _A     =							symbols(_SCREAMING_SNAKE_CASE				)
    _A     =							lambdify(_SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)
    _A     =							lambdify(_SCREAMING_SNAKE_CASE							,     diff(_SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)				)

    _A     =							starting_point

    while True:
        if diff_function(_SCREAMING_SNAKE_CASE				) != 0:
            _A     =							prev_guess - multiplicity * func(_SCREAMING_SNAKE_CASE				) / diff_function(
                _SCREAMING_SNAKE_CASE				)
        else:
            raise ZeroDivisionError('Could not find root'				) from None

        # Precision is checked by comparing the difference of consecutive guesses
        if abs(next_guess - prev_guess				) < precision:
            return next_guess

        _A     =							next_guess


# Let's Execute
if __name__ == "__main__":
 # Find root of trigonometric function
 # Find value of pi
 print(f"The root of sin(x) = 0 is {newton_raphson('sin(x)', 2)}")

 # Find root of polynomial
 # Find fourth Root of 5
 print(f"The root of x**4 - 5 = 0 is {newton_raphson('x**4 -5', 0.4 +5j)}")

 # Find value of e
 print(
     "The root of log(y) - 1 = 0 is ",
     f"{newton_raphson('log(y) - 1', 2, variable='y')}",
 )

 # Exponential Roots
 print(
     "The root of exp(x) - 1 = 0 is",
     f"{newton_raphson('exp(x) - 1', 10, precision=0.0_0_5)}",
 )

 # Find root of cos(x)
 print(f"The root of cos(x) = 0 is {newton_raphson('cos(x)', 0)}")












"""simple docstring"""


def        lowercase__     (       lowercase_      )       ->		list:




      """simple docstring"""

      if len(lowercase_      ) <= 1:
            return [tuple(lowercase_      )]

      _UpperCamelCase   :						Optional[Any]    =							[]

      def generate(lowercase_		,lowercase_      ):
            if k == 1:
                  res.append(tuple(arr[:]      )      )
                  return

            generate(k - 1		,lowercase_      )

            for i in range(k - 1      ):
                  if k % 2 == 0:  # k is even
                        _UpperCamelCase,	_UpperCamelCase   :						List[str]    =							arr[k - 1], arr[i]
                  else:  # k is odd
                        _UpperCamelCase,	_UpperCamelCase   :						int    =							arr[k - 1], arr[0]
                  generate(k - 1		,lowercase_      )

      generate(len(lowercase_      )		,lowercase_      )
      return res


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