



import contextlib
import faulthandler
import io
import multiprocessing
import os
import platform
import signal
import tempfile





def 					__snake_case     (      _UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase    ):
    __a							=    multiprocessing.Manager()
    __a							=    manager.list()

    __a							=    multiprocessing.Process(target=lowercase__       ,			args=(check_program, result, timeout)    )
    p.start()
    p.join(timeout=timeout + 1    )
    if p.is_alive():
        p.kill()

    if not result:
        result.append('''timed out'''    )

    return {
        "task_id": task_id,
        "passed": result[0] == "passed",
        "result": result[0],
        "completion_id": completion_id,
    }





def 					__snake_case     (      _UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase    ):
    with create_tempdir():
        # These system calls are needed when cleaning up tempdir.
        import os
        import shutil

        __a							=    shutil.rmtree
        __a							=    os.rmdir
        __a							=    os.chdir

        # Disable functionalities that can make destructive changes to the test.
        reliability_guard()

        # Run program.
        try:
            __a							=    {}
            with swallow_io():
                with time_limit(lowercase__    ):
                    exec(lowercase__       ,			lowercase__    )
            result.append('''passed'''    )
        except TimeoutException:
            result.append('''timed out'''    )
        except BaseException as e:
            result.append(f'failed: {e}'    )

        # Needed for cleaning up.
        __a							=    rmtree
        __a							=    rmdir
        __a							=    chdir





@contextlib.contextmanager
def 					__snake_case     (      _UpperCAmelCase    ):
    def signal_handler(_UpperCAmelCase       ,			_UpperCAmelCase    ):
        raise TimeoutException('''Timed out!'''    )

    signal.setitimer(signal.ITIMER_REAL       ,			lowercase__    )
    signal.signal(signal.SIGALRM       ,			lowercase__    )
    try:
        yield
    finally:
        signal.setitimer(signal.ITIMER_REAL       ,			0    )





@contextlib.contextmanager
def 					__snake_case     (      ):
    __a							=    WriteOnlyStringIO()
    with contextlib.redirect_stdout(lowercase__    ):
        with contextlib.redirect_stderr(lowercase__    ):
            with redirect_stdin(lowercase__    ):
                yield





@contextlib.contextmanager
def 					__snake_case     (      ):
    with tempfile.TemporaryDirectory() as dirname:
        with chdir(lowercase__    ):
            yield dirname

class    _A	(     _A   ):
       pass


class    _A	(     io.StringIO   ):



       def 		_lowerCamelCase      (		self							:					List[Any]					,		*__SCREAMING_SNAKE_CASE							:					Tuple					,		**__SCREAMING_SNAKE_CASE							:					List[Any]):


           '''simple docstring'''

           raise OSError



       def 		_lowerCamelCase      (		self							:					Union[str, Any]					,		*__SCREAMING_SNAKE_CASE							:					int					,		**__SCREAMING_SNAKE_CASE							:					Tuple):


           '''simple docstring'''

           raise OSError



       def 		_lowerCamelCase      (		self							:					Dict					,		*__SCREAMING_SNAKE_CASE							:					Any					,		**__SCREAMING_SNAKE_CASE							:					Union[str, Any]):


           '''simple docstring'''

           raise OSError





       def 		_lowerCamelCase      (		self							:					Any					,		*__SCREAMING_SNAKE_CASE							:					int					,		**__SCREAMING_SNAKE_CASE							:					List[Any]):


           '''simple docstring'''

           return False


class    _A	(     contextlib._RedirectStream   ):  # type: ignore
       UpperCamelCase__  :   List[str]						 =						'''stdin'''





@contextlib.contextmanager
def 					__snake_case     (      _UpperCAmelCase    ):
    if root == ".":
        yield
        return
    __a							=    os.getcwd()
    os.chdir(lowercase__    )
    try:
        yield
    except BaseException as exc:
        raise exc
    finally:
        os.chdir(lowercase__    )





def 					__snake_case     (      _UpperCAmelCase=None    ):

    if maximum_memory_bytes is not None:
        import resource

        resource.setrlimit(resource.RLIMIT_AS       ,			(maximum_memory_bytes, maximum_memory_bytes)    )
        resource.setrlimit(resource.RLIMIT_DATA       ,			(maximum_memory_bytes, maximum_memory_bytes)    )
        if not platform.uname().system == "Darwin":
            resource.setrlimit(resource.RLIMIT_STACK       ,			(maximum_memory_bytes, maximum_memory_bytes)    )

    faulthandler.disable()

    import builtins

    __a							=    None
    __a							=    None

    import os

    __a							=    '''1'''

    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None

    import shutil

    __a							=    None
    __a							=    None
    __a							=    None

    import subprocess

    __a							=    None  # type: ignore

    __a							=    None

    import sys

    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None
    __a							=    None








def 					__snake_case     (      _UpperCAmelCase       ,			_UpperCAmelCase    ):
    return base * power(_UpperCAmelCase       ,			(exponent - 1)    ) if exponent else 1


if __name__ == "__main__":
 print('''Raise base to the power of exponent using recursion...''')
 __snake_case						:List[Any]						=					int(input('''Enter the base: ''').strip())
 __snake_case						:Dict						=					int(input('''Enter the exponent: ''').strip())
 __snake_case						:int						=					power(base, abs(exponent))
 if exponent < 0:  # power() does not properly deal w/ negative exponents
  __snake_case						:Optional[Any]						=					1 / result
 print(f'{base} to the power of {exponent} is {result}')





