






"""simple docstring"""





import timeit







class 		_a   :





   '''simple docstring'''






   def __init__(    self ,      UpperCAmelCase_)       ->					Union[str, Any]:




          '''simple docstring'''




          if isinstance(lowerCAmelCase__ ,      lowerCAmelCase__):  # Initializes a matrix identical to the one provided.
                 lowercase__:				List[str]			  =			arg
                 lowercase__:				Optional[int]			  =			len(lowerCAmelCase__)
          else:  # Initializes a square matrix of the given size and set values to zero.
                 lowercase__:				int			  =			arg
                 lowercase__:				Union[str, Any]			  =			[[0 for _ in range(self.n)] for _ in range(self.n)]





   def __mul__(    self ,      UpperCAmelCase_)       ->					Tuple:




          '''simple docstring'''




          lowercase__:				Dict			  =			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 				A(  snake_case_						,   snake_case_		):
       """simple docstring"""





       lowercase__:				int			  =			Matrix([[1, 0], [0, 1]]		)
       while b > 0:
              if b & 1:
                     matrix *= a
              a *= a
              b >>= 1
       return matrix






def 				A(  snake_case_						,   snake_case_						,   snake_case_		):
       """simple docstring"""





       if n == 1:
              return fa
       elif n == 2:
              return fa
       lowercase__:				str			  =			Matrix([[1, 1], [1, 0]]		)
       lowercase__:				Optional[int]			  =			modular_exponentiation(lowerCAmelCase_						,   n - 2		)
       return fa * matrix.t[0][0] + fa * matrix.t[0][1]






def 				A(  snake_case_						,   snake_case_						,   snake_case_		):
       """simple docstring"""





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

       lowercase__:				Optional[int]			  =			fa
       lowercase__:				Dict			  =			fa
       n -= 2

       while n > 0:
              lowercase__:				Any			  =			fn_a + fn_a, fn_a
              n -= 1

       return fn_a






def 				A(  ):
       """simple docstring"""





       lowercase__:				Union[str, Any]			  =			"""
from random import randint
from __main__ import fibonacci_with_matrix_exponentiation
"""
       lowercase__:				Union[str, Any]			  =			"""fibonacci_with_matrix_exponentiation(randint(1,70000), 1, 1)"""
       lowercase__:				List[str]			  =			timeit.timeit(setup=lowerCAmelCase_						,   stmt=lowerCAmelCase_						,   number=100		)
       print("With matrix exponentiation the average execution time is "						,   exec_time / 100		)
       return exec_time






def 				A(  ):
       """simple docstring"""





       lowercase__:				Dict			  =			"""
from random import randint
from __main__ import simple_fibonacci
"""
       lowercase__:				Optional[int]			  =			"""simple_fibonacci(randint(1,70000), 1, 1)"""
       lowercase__:				Any			  =			timeit.timeit(setup=lowerCAmelCase_						,   stmt=lowerCAmelCase_						,   number=100		)
       print(
           "Without matrix exponentiation the average execution time is "						,   exec_time / 100		)
       return exec_time






def 				A(  ):
       """simple docstring"""





       matrix_exponentiation_time()
       simple_fibonacci_time()


if __name__ == "__main__":
  main()








'''simple docstring'''

from itertools import permutations







def __A  (    ):
     _UpperCAmelCase					:  Union[str, Any]         =    list(map("""""".join ,       permutations("""0123456789"""       )       )       )
     return result[99_9999]


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


