code: 
  
  
  
  
  
  import timeit
  
  
  
  
  
  
  class 	UpperCamelCase_     :
  
  
  
  					def __init__(		self    :    str					,			lowerCamelCase    :    Tuple	):
  							if isinstance(lowerCamelCase					,			lowerCamelCase	):  # Initializes a matrix identical to the one provided.
  									lowerCamelCase_  :    List[Any]   	=			arg
  									lowerCamelCase_  :    Optional[Any]   	=			len(lowerCamelCase	)
  							else:  # Initializes a square matrix of the given size and set values to zero.
  									lowerCamelCase_  :    str   	=			arg
  									lowerCamelCase_  :    str   	=			[[0 for _ in range(self.n	)] for _ in range(self.n	)]
  
  
  
  
  
  					def __mul__(		self    :    Dict					,			lowerCamelCase    :    List[str]	):
  							lowerCamelCase_  :    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 		_SCREAMING_SNAKE_CASE    (   lowerCAmelCase__       ,lowerCAmelCase__	):
  		lowerCamelCase_  :    str   	=			Matrix([[1, 0], [0, 1]]	)
  		while b > 0:
  				if b & 1:
  						matrix *= a
  				a *= a
  				b >>= 1
  		return matrix
  
  
  def 		_SCREAMING_SNAKE_CASE    (   lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__	):
  		# Trivial Cases
  		if n == 1:
  				return fa
  		elif n == 2:
  				return fa
  		lowerCamelCase_  :    Optional[Any]   	=			Matrix([[1, 1], [1, 0]]	)
  		lowerCamelCase_  :    int   	=			modular_exponentiation(lowerCAmelCase__       ,n - 2	)
  		return fa * matrix.t[0][0] + fa * matrix.t[0][1]
  
  
  def 		_SCREAMING_SNAKE_CASE    (   lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__	):
  		# Trivial Cases
  		if n == 1:
  				return fa
  		elif n == 2:
  				return fa
  
  		lowerCamelCase_  :    Tuple   	=			fa
  		lowerCamelCase_  :    List[str]   	=			fa
  		n -= 2
  
  		while n > 0:
  				lowerCamelCase_  :    Optional[Any]   	=			fn_a + fn_a, fn_a
  				n -= 1
  
  		return fn_a
  
  
  def 		_SCREAMING_SNAKE_CASE    (   ):
  		lowerCamelCase_  :    str   	=			'\nfrom random import randint\nfrom __main__ import fibonacci_with_matrix_exponentiation\n'
  		lowerCamelCase_  :    Union[str, Any]   	=			'fibonacci_with_matrix_exponentiation(randint(1,70000), 1, 1)'
  		lowerCamelCase_  :    Dict   	=			timeit.timeit(setup=lowerCAmelCase__       ,stmt=lowerCAmelCase__       ,number=1_00	)
  		print('With matrix exponentiation the average execution time is '       ,exec_time / 1_00	)
  		return exec_time
  
  
  def 		_SCREAMING_SNAKE_CASE    (   ):
  		lowerCamelCase_  :    Union[str, Any]   	=			'\nfrom random import randint\nfrom __main__ import simple_fibonacci\n'
  		lowerCamelCase_  :    Dict   	=			'simple_fibonacci(randint(1,70000), 1, 1)'
  		lowerCamelCase_  :    Optional[Any]   	=			timeit.timeit(setup=lowerCAmelCase__       ,stmt=lowerCAmelCase__       ,number=1_00	)
  		print(
  		    'Without matrix exponentiation the average execution time is '       ,exec_time / 1_00	)
  		return exec_time
  
  
  def 		_SCREAMING_SNAKE_CASE    (   ):
  		matrix_exponentiation_time()
  		simple_fibonacci_time()
  
  
  if __name__ == "__main__":
  		main()
  
style_context: 
  
  
  
  
  
  from __future__ import annotations
  
  
  def 		_SCREAMING_SNAKE_CASE    (   lowerCAmelCase__	):
  		lowerCamelCase_  :    int
  		lowerCamelCase_  :    list[str]   	=			list(lowerCAmelCase__	)
  		lowerCamelCase_	,			lowerCamelCase_  :    List[str]   	=			_vector[:-1], int(_vector[-1]	)
  		lowerCamelCase_  :    list[int]   	=			[int(lowerCAmelCase__	) for digit in __vector]
  
  		vector.reverse()
  		for i, digit in enumerate(lowerCAmelCase__	):
  				if i & 1 == 0:
  						lowerCamelCase_  :    int   	=			digit * 2
  						if doubled > 9:
  								doubled -= 9
  						check_digit += doubled
  				else:
  						check_digit += digit
  
  		return check_digit % 10 == 0
  
  
  if __name__ == "__main__":
  		import doctest
  
  		doctest.testmod()
  		assert is_luhn("""79927398713""")
  		assert not is_luhn("""79927398714""")
  