'''simple docstring'''

def 					UpperCAmelCase__      (							_lowerCAmelCase						: int)						->		int:



						"""simple docstring"""

						if not isinstance(_lowerCAmelCase,			_lowerCAmelCase) or number < 0:
												raise ValueError("Input must be a non-negative integer")

						snake_case   :					Tuple							=						number & ~(number - 1)
						snake_case   :					str							=						0
						while intermediate:
												intermediate >>= 1
												index += 1
						return index - 1


if __name__ == "__main__":
						import doctest

						doctest.testmod(verbose=True)






'''simple docstring'''

from __future__ import annotations


def 					UpperCAmelCase__      (							_lowerCAmelCase						: int)						->		int | None:



						"""simple docstring"""

						for r in range(1,			_lowerCAmelCase):
												snake_case   :					Optional[Any]							=						[]
												for x in range(n - 1):
																		snake_case   :					int							=						pow(_lowerCAmelCase,			_lowerCAmelCase,			_lowerCAmelCase)
																		if val in li:
																								break
																		li.append(_lowerCAmelCase)
												else:
																		return r
						return None


if __name__ == "__main__":
						A_        =   int(input("Enter a prime number q: "))
						A_        =   find_primitive(q)
						if a is None:
												print(f"Cannot find the primitive for the value: {a!r}")
						else:
												A_        =   int(input("Enter private key of A: "))
												A_        =   pow(a, a_private, q)
												A_        =   int(input("Enter private key of B: "))
												A_        =   pow(a, b_private, q)

												A_        =   pow(b_public, a_private, q)
												A_        =   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)





