




import math
from timeit import timeit

def       __lowerCamelCase							(     __UpperCamelCase)    ->  int:
     a											=   0
     a											=   abs(__UpperCamelCase)
     while True:
          a											=   n // 10
          digits += 1
          if n == 0:
               break
     return digits

def       __lowerCamelCase							(     __UpperCamelCase)    ->  int:
     return 1 if n == 0 else math.floor(math.log(abs(__UpperCamelCase)	,      10) + 1)

def       __lowerCamelCase							(     __UpperCamelCase)    ->  int:
     return len(str(abs(__UpperCamelCase)))

def       __lowerCamelCase							(     )    ->  None:
     from collections.abc import Callable

     def benchmark_a_function(__UpperCamelCase	,      __UpperCamelCase) -> None:
          a											=   f'''{func.__name__}({value})'''
          a											=   timeit(f'''__main__.{call}'''	,      setup="import __main__")
          print(f'''{call}: {func(__UpperCamelCase)} -- {timing} seconds''')

     for value in (26_21_44, 11_25_89_99_06_84_26_24, 1_26_76_50_60_02_28_22_94_01_49_67_03_20_53_76):
          for func in (num_digits, num_digits_fast, num_digits_faster):
               benchmark_a_function(__UpperCamelCase	,      __UpperCamelCase)
          print()


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   benchmark()







from __future__ import annotations

def       SCREAMING_SNAKE_CASE							(     __UpperCamelCase)    ->  int | None:
     for r in range(1	,      __UpperCamelCase):
          a											=   []
          for x in range(n - 1):
               a											=   pow(__UpperCamelCase	,      __UpperCamelCase	,      __UpperCamelCase)
               if val in li:
                    break
               li.append(__UpperCamelCase)
          else:
               return r
     return None


if __name__ == "__main__":
   lowercase__   :    Tuple 					=      int(input("Enter a prime number q: "))
   lowercase__   :    List[Any] 					=      find_primitive(q)
   if a is None:
      print(F'Cannot find the primitive for the value: {a!r}')
   else:
      lowercase__   :    Any 					=      int(input("Enter private key of A: "))
      lowercase__   :    Optional[int] 					=      pow(a, a_private, q)
      lowercase__   :    Optional[Any] 					=      int(input("Enter private key of B: "))
      lowercase__   :    Any 					=      pow(a, b_private, q)

      lowercase__   :    Optional[Any] 					=      pow(b_public, a_private, q)
      lowercase__   :    List[str] 					=      pow(a_public, b_private, q)

      print("The key value generated by A is: ", a_secret)
      print("The key value generated by B is: ", b_secret)

