


'''simple docstring'''

from __future__ import annotations



def 							SCREAMING_SNAKE_CASE__(		_UpperCamelCase   :					int )		->       int | None:





   '''simple docstring'''







   for r in range(1     ,		_UpperCamelCase ):
      UpperCamelCase__			    =    []
      for x in range(n - 1 ):
         UpperCamelCase__			    =    pow(_UpperCamelCase     ,		_UpperCamelCase     ,		_UpperCamelCase )
         if val in li:
            break
         li.append(_UpperCamelCase )
      else:
         return r
   return None


if __name__ == "__main__":
       __lowercase:		Optional[Any]    						=  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:		List[Any]    						=  int(input("Enter private key of A: "))
              __lowercase:		List[str]    						=  pow(a, a_private, q)
              __lowercase:		Union[str, Any]    						=  int(input("Enter private key of B: "))
              __lowercase:		str    						=  pow(a, b_private, q)

              __lowercase:		List[Any]    						=  pow(b_public, a_private, q)
              __lowercase:		List[Any]    						=  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)

_A       =					{
    "0": 1,
    "1": 1,
    "2": 2,
    "3": 6,
    "4": 24,
    "5": 1_20,
    "6": 7_20,
    "7": 50_40,
    "8": 4_03_20,
    "9": 36_28_80,
}

_A       =					{1_45: 1_45}

_A       =					{
    1_45: 0,
    1_69: 3,
    3_63_01: 3,
    14_54: 3,
    8_71: 2,
    4_53_61: 2,
    8_72: 2,
}



def 		lowercase_     (  A__						)				->				int:
    """simple docstring"""

    if n in CACHE_SUM_DIGIT_FACTORIALS:
        return CACHE_SUM_DIGIT_FACTORIALS[n]
    snake_case						=   sum(DIGIT_FACTORIALS[let] for let in str(A__						)						)
    snake_case						=   ret
    return ret



def 		lowercase_     (  A__					,						A__ = None						)				->				int:
    """simple docstring"""

    snake_case						=   previous or set()
    if n in CHAIN_LENGTH_CACHE:
        return CHAIN_LENGTH_CACHE[n]
    snake_case						=   sum_digit_factorials(A__						)
    if next_number in previous:
        snake_case						=   0
        return 0
    else:
        previous.add(A__						)
        snake_case						=   1 + chain_length(A__					,						A__						)
        snake_case						=   ret
        return ret



def 		lowercase_     (  A__ = 60					,						A__ = 100_0000						)				->				int:
    """simple docstring"""

    return sum(1 for i in range(1					,						A__						) if chain_length(A__						) == num_terms						)


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

