



__UpperCAmelCase    	=  {
    '''+''': lambda x, y: x + y,
    '''-''': lambda x, y: x - y,
    '''*''': lambda x, y: x * y,
    '''/''': lambda x, y: x / y,
}





def     __lowerCamelCase							(   __magic_name__						:	Tuple    ):
							return c.isdigit()





def     __lowerCamelCase							(   __magic_name__						:	int    ):
							a__:							Tuple									=[]

							# iterate over the string in reverse order
							for c in expression.split()[::-1]:
														# push operand to stack
														if is_operand(__magic_name__    ):
																					stack.append(int(__magic_name__    )    )

														else:
																					# pop values from stack can calculate the result
																					# push the result onto the stack again
																					a__:							Union[str, Any]									=stack.pop()
																					a__:							Tuple									=stack.pop()
																					stack.append(calc[c](__magic_name__  ,			__magic_name__    )    )

							return stack.pop()


# Driver code
if __name__ == "__main__":
		__UpperCAmelCase    	=  '''+ 9 * 2 6'''
		print(evaluate(test_expression))

		__UpperCAmelCase    	=  '''/ * 10 2 + 4 1 '''
		print(evaluate(test_expression))










from __future__ import annotations





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


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

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





