"""simple docstring"""







def     __UpperCAmelCase							(       UpperCAmelCase_       :							Union[str, Any]    )				->     bool:

	'''simple docstring'''





	if not isinstance(_lowercase     ,				_lowercase    ):
		raise ValueError('Input series is not valid, valid series - [2, 4, 8]'    )
	if len(_lowercase    ) == 0:
		raise ValueError('Input list must be a non empty list'    )
	if len(_lowercase    ) == 1:
		return True
	try:
		__snake_case     :				Optional[Any] 						=					series[1] / series[0]
		for index in range(len(_lowercase    ) - 1    ):
			if series[index + 1] / series[index] != common_ratio:
				return False
	except ZeroDivisionError:
		return False
	return True
def     __UpperCAmelCase							(       UpperCAmelCase_       :							int    )				->     float:

	'''simple docstring'''





	if not isinstance(_lowercase     ,				_lowercase    ):
		raise ValueError('Input series is not valid, valid series - [2, 4, 8]'    )
	if len(_lowercase    ) == 0:
		raise ValueError('Input list must be a non empty list'    )
	__snake_case     :				Optional[Any] 						=					1
	for value in series:
		answer *= value
	return pow(_lowercase     ,				1 / len(_lowercase    )    )


if __name__ == "__main__":
	import doctest

	doctest.testmod()










'''simple docstring'''




from __future__ import annotations



def  __lowerCamelCase    (   _lowercase						) ->     int | None:
							for r in range(1      ,							_lowercase						):
														UpperCAmelCase	:						Dict					=						[]
														for x in range(n - 1						):
																					UpperCAmelCase	:						List[str]					=						pow(_lowercase      ,							_lowercase      ,							_lowercase						)
																					if val in li:
																												break
																					li.append(_lowercase						)
														else:
																					return r
							return None


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

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

