

from collections.abc import Callable

__A     						=      Callable[[float], float]  # type alias for a real -> real function



def  snake_case_(_UpperCamelCase					,			_UpperCamelCase					,			_UpperCamelCase					,			)				->      float:



  """simple docstring"""






  _snake_case		=				float(_UpperCamelCase	)
  while True:
    try:
      _snake_case		=				prev_guess - function(_UpperCamelCase	) / derivative(_UpperCamelCase	)
    except ZeroDivisionError:
      raise ZeroDivisionError('''Could not find root'''	) from None
    if abs(prev_guess - next_guess	) < 10**-5:
      return next_guess
    _snake_case		=				next_guess



def  snake_case_(_UpperCamelCase	)				->      float:



  """simple docstring"""






  return (x**3) - (2 * x) - 5



def  snake_case_(_UpperCamelCase	)				->      float:



  """simple docstring"""






  return 3 * (x**2) - 2


if __name__ == "__main__":
 print(newton(f, fa, 3))




from __future__ import annotations

from collections import Counter



def  snake_case_(_UpperCamelCase	)				->      list[int]:



  """simple docstring"""






  _snake_case		=				[True] * n
  _snake_case		=				False
  _snake_case		=				False
  _snake_case		=				True

  for i in range(3					,			int(n**0.5 + 1	)					,			2	):
    _snake_case		=				i * 2
    while index < n:
      _snake_case		=				False
      _snake_case		=				index + i

  _snake_case		=				[2]

  for i in range(3					,			_UpperCamelCase					,			2	):
    if is_prime[i]:
      primes.append(_UpperCamelCase	)

  return primes



def  snake_case_(_UpperCamelCase	)				->      list[list[int]]:



  """simple docstring"""






  _snake_case		=				str(_UpperCamelCase	)
  _snake_case		=				[]
  _snake_case		=				['''0''', '''1''', '''2''', '''3''', '''4''', '''5''', '''6''', '''7''', '''8''', '''9''']

  for duplicate in Counter(_UpperCamelCase	) - Counter(set(_UpperCamelCase	)	):
    _snake_case		=				[int(number_str.replace(_UpperCamelCase					,			_UpperCamelCase	)	) for digit in digits]
    replacements.append(_UpperCamelCase	)

  return replacements



def  snake_case_(_UpperCamelCase = 8	)				->      int:



  """simple docstring"""






  _snake_case		=				set()

  # Filter primes with less than 3 replaceable digits
  _snake_case		=				{
      x for x in set(prime_sieve(1_000_000	)	) if len(str(_UpperCamelCase	)	) - len(set(str(_UpperCamelCase	)	)	) >= 3
  }

  for prime in primes:
    if prime in numbers_checked:
      continue

    _snake_case		=				digit_replacements(_UpperCamelCase	)

    for family in replacements:
      numbers_checked.update(_UpperCamelCase	)
      _snake_case		=				primes.intersection(_UpperCamelCase	)

      if len(_UpperCamelCase	) != family_length:
        continue

      return min(_UpperCamelCase	)

  return -1


if __name__ == "__main__":
 print(solution())

