

from __future__ import annotations

from enum import Enum


class 					A		(				_UpperCAmelCase					):







    """simple docstring"""





    lowerCamelCase						      =				24
    lowerCamelCase						      =				21
    lowerCamelCase						      =				18
    lowerCamelCase						      =				15
    lowerCamelCase						      =				12
    lowerCamelCase						      =				9
    lowerCamelCase						      =				6
    lowerCamelCase						      =				3
    lowerCamelCase						      =				2
    lowerCamelCase						      =				1
    lowerCamelCase						      =				-1
    lowerCamelCase						      =				-2
    lowerCamelCase						      =				-3
    lowerCamelCase						      =				-6
    lowerCamelCase						      =				-9
    lowerCamelCase						      =				-12
    lowerCamelCase						      =				-15
    lowerCamelCase						      =				-18
    lowerCamelCase						      =				-21
    lowerCamelCase						      =				-24




class 					A		(				_UpperCAmelCase					):







    """simple docstring"""





    lowerCamelCase						      =				8
    lowerCamelCase						      =				7
    lowerCamelCase						      =				6
    lowerCamelCase						      =				5
    lowerCamelCase						      =				4
    lowerCamelCase						      =				3
    lowerCamelCase						      =				2
    lowerCamelCase						      =				1




def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      float       ,     SCREAMING_SNAKE_CASE__     :      str | SIUnit       ,     SCREAMING_SNAKE_CASE__     :      str | SIUnit       ,     )				-> float:





    '''simple docstring'''






    if isinstance(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ ):
        A__        =  SIUnit[known_prefix.lower()]
    if isinstance(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ ):
        A__        =  SIUnit[unknown_prefix.lower()]
    A__        =  known_amount * (
        10 ** (known_prefix.value - unknown_prefix.value)
    )
    return unknown_amount
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      float       ,     SCREAMING_SNAKE_CASE__     :      str | BinaryUnit       ,     SCREAMING_SNAKE_CASE__     :      str | BinaryUnit       ,     )				-> float:





    '''simple docstring'''






    if isinstance(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ ):
        A__        =  BinaryUnit[known_prefix.lower()]
    if isinstance(SCREAMING_SNAKE_CASE__       ,     SCREAMING_SNAKE_CASE__ ):
        A__        =  BinaryUnit[unknown_prefix.lower()]
    A__        =  known_amount * (
        2 ** ((known_prefix.value - unknown_prefix.value) * 10)
    )
    return unknown_amount


if __name__ == "__main__":
     import doctest

     doctest.testmod()




import timeit


class 					A		:







    """simple docstring"""





    def __init__( self					:			Optional[int],lowercase_					:			Union[str, Any]						)->       List[str]:





        '''simple docstring'''







        if isinstance(lowercase_,lowercase_						):  # Initializes a matrix identical to the one provided.
            A__        =  arg
            A__        =  len(lowercase_						)
        else:  # Initializes a square matrix of the given size and set values to zero.
            A__        =  arg
            A__        =  [[0 for _ in range(self.n						)] for _ in range(self.n						)]


    def __mul__( self					:			Union[str, Any],lowercase_					:			List[Any]						)->       List[str]:





        '''simple docstring'''







        A__        =  Matrix(self.n						)
        for i in range(self.n						):
            for j in range(self.n						):
                for k in range(self.n						):
                    matrix.t[i][j] += self.t[i][k] * b.t[k][j]
        return matrix




def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      List[Any]       ,     SCREAMING_SNAKE_CASE__     :      Optional[Any] )				-> Union[str, Any]:





    '''simple docstring'''






    A__        =  Matrix([[1, 0], [0, 1]] )
    while b > 0:
        if b & 1:
            matrix *= a
        a *= a
        b >>= 1
    return matrix
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      Optional[int]       ,     SCREAMING_SNAKE_CASE__     :      str       ,     SCREAMING_SNAKE_CASE__     :      Any )				-> List[str]:





    '''simple docstring'''






    if n == 1:
        return fa
    elif n == 2:
        return fa
    A__        =  Matrix([[1, 1], [1, 0]] )
    A__        =  modular_exponentiation(SCREAMING_SNAKE_CASE__       ,     n - 2 )
    return fa * matrix.t[0][0] + fa * matrix.t[0][1]
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      Dict       ,     SCREAMING_SNAKE_CASE__     :      Tuple       ,     SCREAMING_SNAKE_CASE__     :      Tuple )				-> Dict:





    '''simple docstring'''






    if n == 1:
        return fa
    elif n == 2:
        return fa

    A__        =  fa
    A__        =  fa
    n -= 2

    while n > 0:
        A__ ,		A__        =  fn_a + fn_a, fn_a
        n -= 1

    return fn_a
def 		_snake_case(       )				-> Optional[Any]:





    '''simple docstring'''






    A__        =  '\nfrom random import randint\nfrom __main__ import fibonacci_with_matrix_exponentiation\n'
    A__        =  'fibonacci_with_matrix_exponentiation(randint(1,70000), 1, 1)'
    A__        =  timeit.timeit(setup=SCREAMING_SNAKE_CASE__       ,     stmt=SCREAMING_SNAKE_CASE__       ,     number=100 )
    print('With matrix exponentiation the average execution time is '       ,     exec_time / 100 )
    return exec_time
def 		_snake_case(       )				-> Optional[int]:





    '''simple docstring'''






    A__        =  '\nfrom random import randint\nfrom __main__ import simple_fibonacci\n'
    A__        =  'simple_fibonacci(randint(1,70000), 1, 1)'
    A__        =  timeit.timeit(setup=SCREAMING_SNAKE_CASE__       ,     stmt=SCREAMING_SNAKE_CASE__       ,     number=100 )
    print(
        'Without matrix exponentiation the average execution time is '       ,     exec_time / 100 )
    return exec_time
def 		_snake_case(       )				-> Union[str, Any]:





    '''simple docstring'''






    matrix_exponentiation_time()
    simple_fibonacci_time()


if __name__ == "__main__":
     main()

