


'''simple docstring'''




def      _a		(lowercase__ :      Optional[Any]       ,      lowercase__ :      int       ,      lowercase__ :      str	) -> Optional[int]:






     """simple docstring"""
     assert b != 0, "This cannot accept modulo that is == 0"
     if n == 0:
          return 1

     if n % 2 == 1:
          return (bin_exp_mod(lowercase__       ,      n - 1       ,      lowercase__	) * a) % b

     __snake_case    			=	bin_exp_mod(lowercase__       ,      n / 2       ,      lowercase__	)
     return (r * r) % b


if __name__ == "__main__":
       try:
              _a      :      Union[str, Any]       				=      int(input("Enter Base : ").strip())
              _a      :      List[Any]       				=      int(input("Enter Power : ").strip())
              _a      :      Tuple       				=      int(input("Enter Modulo : ").strip())
       except ValueError:
              print("Invalid literal for integer")

       print(bin_exp_mod(BASE, POWER, MODULO))








'''simple docstring'''




import warnings
from collections.abc import Callable
from typing import Any

import numpy
from matplotlib import pyplot

_a      :      Optional[int]       				=      0.25 + 0.0J
_a      :      Dict       				=      -0.4 + 0.6J
_a      :      List[str]       				=      -0.1 + 0.651J
_a      :      Optional[int]       				=      -2.0
_a      :      List[str]       				=      56
_a      :      Tuple       				=      2.0
_a      :      List[str]       				=      666





def      _a		(lowercase__ :      complex       ,      lowercase__ :      numpy.ndarray	) -> numpy.ndarray:






     """simple docstring"""
     return numpy.exp(lowercase__	) + c_parameter





def      _a		(lowercase__ :      complex       ,      lowercase__ :      numpy.ndarray	) -> numpy.ndarray:






     """simple docstring"""
     return z_values * z_values + c_parameter





def      _a		(lowercase__ :      float       ,      lowercase__ :      int	) -> numpy.ndarray:






     """simple docstring"""
     __snake_case    			=	numpy.linspace(-window_size       ,      lowercase__       ,      lowercase__	)
     __snake_case    			=	x.reshape((nb_pixels, 1)	)
     __snake_case    			=	numpy.linspace(-window_size       ,      lowercase__       ,      lowercase__	)
     __snake_case    			=	y.reshape((1, nb_pixels)	)
     return x + 1.0J * y





def      _a		(lowercase__ :      Callable[[Any, numpy.ndarray], numpy.ndarray]       ,      lowercase__ :      Any       ,      lowercase__ :      int       ,      lowercase__ :      numpy.ndarray       ,      lowercase__ :      float | None = None       ,      ) -> numpy.ndarray:






     """simple docstring"""
     __snake_case    			=	z_a.astype('complex64'	)
     for _ in range(lowercase__	):
          __snake_case    			=	eval_function(lowercase__       ,      lowercase__	)
          if infinity is not None:
               numpy.nan_to_num(lowercase__       ,      copy=lowercase__       ,      nan=lowercase__	)
               __snake_case    			=	infinity
     return z_n





def      _a		(lowercase__ :      str       ,      lowercase__ :      Any       ,      lowercase__ :      float       ,      lowercase__ :      numpy.ndarray       ,      ) -> None:






     """simple docstring"""
     __snake_case    			=	(abs(lowercase__	)).transpose()
     __snake_case    			=	abs_z_final[::-1, :]
     pyplot.matshow(abs_z_final < escape_radius	)
     pyplot.title(f'Julia set of ${function_label}$, $c={function_params}$'	)
     pyplot.show()





def      _a		() -> None:






     """simple docstring"""
     warnings.filterwarnings(
         'ignore'       ,      category=lowercase__       ,      message='overflow encountered in multiply'	)
     warnings.filterwarnings(
         'ignore'       ,      category=lowercase__       ,      message='invalid value encountered in multiply'       ,      )
     warnings.filterwarnings(
         'ignore'       ,      category=lowercase__       ,      message='overflow encountered in absolute'	)
     warnings.filterwarnings(
         'ignore'       ,      category=lowercase__       ,      message='overflow encountered in exp'	)


if __name__ == "__main__":
       _a      :      List[Any]       				=      prepare_grid(window_size, nb_pixels)

       ignore_overflow_warnings()  # See file header for explanations

       _a      :      Optional[Any]       				=      24
       _a      :      Optional[int]       				=      2 * abs(c_cauliflower) + 1
       _a      :      List[str]       				=      iterate_function(
           eval_quadratic_polynomial,
           c_cauliflower,
           nb_iterations,
           z_a,
           infinity=1.1 * escape_radius,
       )
       show_results("z^2+c", c_cauliflower, escape_radius, z_final)

       _a      :      str       				=      64
       _a      :      Tuple       				=      2 * abs(c_polynomial_a) + 1
       _a      :      List[Any]       				=      iterate_function(
           eval_quadratic_polynomial,
           c_polynomial_a,
           nb_iterations,
           z_a,
           infinity=1.1 * escape_radius,
       )
       show_results("z^2+c", c_polynomial_a, escape_radius, z_final)

       _a      :      List[Any]       				=      161
       _a      :      Tuple       				=      2 * abs(c_polynomial_a) + 1
       _a      :      int       				=      iterate_function(
           eval_quadratic_polynomial,
           c_polynomial_a,
           nb_iterations,
           z_a,
           infinity=1.1 * escape_radius,
       )
       show_results("z^2+c", c_polynomial_a, escape_radius, z_final)

       _a      :      str       				=      12
       _a      :      Optional[Any]       				=      10_000.0
       _a      :      Dict       				=      iterate_function(
           eval_exponential,
           c_exponential,
           nb_iterations,
           z_a + 2,
           infinity=1.0e1_0,
       )
       show_results("e^z+c", c_exponential, escape_radius, z_final)




