

import sys

sys.set_int_max_str_digits(0)  # type: ignore
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      int )				-> bool:





    '''simple docstring'''






    A__        =  [0] * 11
    A__        =  [0] * 11

    # mark last 9 numbers
    for _ in range(9 ):
        A__        =  1
        A__        =  number // 10
    # flag
    A__        =  True

    # check last 9 numbers for pandigitality

    for x in range(9 ):
        if not check_last[x + 1]:
            A__        =  False
    if not f:
        return f

    # mark first 9 numbers
    A__        =  int(str(SCREAMING_SNAKE_CASE__ )[:9] )

    for _ in range(9 ):
        A__        =  1
        A__        =  number // 10

    # check first 9 numbers for pandigitality

    for x in range(9 ):
        if not check_front[x + 1]:
            A__        =  False
    return f
def 		_snake_case(       SCREAMING_SNAKE_CASE__     :      int )				-> bool:





    '''simple docstring'''






    A__        =  [0] * 11

    # mark last 9 numbers
    for _ in range(9 ):
        A__        =  1
        A__        =  number // 10
    # flag
    A__        =  True

    # check last 9 numbers for pandigitality

    for x in range(9 ):
        if not check_last[x + 1]:
            A__        =  False
    return f
def 		_snake_case(       )				-> int:





    '''simple docstring'''






    A__        =  1
    A__        =  1
    A__        =  2
    # temporary Fibonacci numbers

    A__        =  1
    A__        =  1
    A__        =  2
    # temporary Fibonacci numbers mod 1e9

    # mod m=1e9, done for fast optimisation
    A__        =  [0] * 1000000
    A__        =  1000000000

    for x in range(1000000 ):
        A__        =  (aa + ba) % m
        A__        =  ba % m
        A__        =  ca % m
        if checka(SCREAMING_SNAKE_CASE__ ):
            A__        =  1

    for x in range(1000000 ):
        A__        =  a + b
        A__        =  b
        A__        =  c
        # perform check only if in tocheck
        if tocheck[x + 3] and check(SCREAMING_SNAKE_CASE__ ):
            return x + 3  # first 2 already done
    return -1


if __name__ == "__main__":
     print(f"""{solution() = }""")




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()

