




from __future__ import annotations

from typing import Generic, TypeVar

lowercase_		=							TypeVar('''T''')





class 		A__				(   __UpperCAmelCase ):
	pass





class 		A__				(   __UpperCAmelCase ):
	pass





class 		A__				(   Generic[T] ):






	def __init__(	self				,     lowerCamelCase = 10						)      ->   Dict:




						"""simple docstring"""






						__magic_name__					:							list[T]		   =							[]
						__magic_name__					:							List[Any]		   =							limit






	def __bool__(	self						)      ->   bool:




						"""simple docstring"""






						return bool(self.stack						)






	def __str__(	self						)      ->   str:




						"""simple docstring"""






						return str(self.stack						)






	def  lowercase      (	self				,     lowerCamelCase						)      ->   None:




						"""simple docstring"""






						if len(self.stack						) >= self.limit:
											raise StackOverflowError
						self.stack.append(UpperCAmelCase_						)






	def  lowercase      (	self						)      ->   T:




						"""simple docstring"""






						if not self.stack:
											raise StackUnderflowError
						return self.stack.pop()






	def  lowercase      (	self						)      ->   T:




						"""simple docstring"""






						if not self.stack:
											raise StackUnderflowError
						return self.stack[-1]






	def  lowercase      (	self						)      ->   bool:




						"""simple docstring"""






						return not bool(self.stack						)






	def  lowercase      (	self						)      ->   bool:




						"""simple docstring"""






						return self.size() == self.limit






	def  lowercase      (	self						)      ->   int:




						"""simple docstring"""






						return len(self.stack						)






	def __contains__(	self				,     lowerCamelCase						)      ->   bool:




						"""simple docstring"""






						return item in self.stack







def  lowerCAmelCase  (	)  ->Dict:






					"""simple docstring"""






					__magic_name__					:							Stack[int]		   =							Stack(10       )
					assert bool(a_       ) is False
					assert stack.is_empty() is True
					assert stack.is_full() is False
					assert str(a_       ) == "[]"

					try:
										__magic_name__					:							str		   =							stack.pop()
										raise AssertionError  # This should not happen
					except StackUnderflowError:
										assert True  # This should happen

					try:
										__magic_name__					:							Tuple		   =							stack.peek()
										raise AssertionError  # This should not happen
					except StackUnderflowError:
										assert True  # This should happen

					for i in range(10       ):
										assert stack.size() == i
										stack.push(a_       )

					assert bool(a_       )
					assert not stack.is_empty()
					assert stack.is_full()
					assert str(a_       ) == str(list(range(10       )       )       )
					assert stack.pop() == 9
					assert stack.peek() == 8

					stack.push(100       )
					assert str(a_       ) == str([0, 1, 2, 3, 4, 5, 6, 7, 8, 100]       )

					try:
										stack.push(200       )
										raise AssertionError  # This should not happen
					except StackOverflowError:
										assert True  # This should happen

					assert not stack.is_empty()
					assert stack.size() == 10

					assert 5 in stack
					assert 55 not in stack


if __name__ == "__main__":
				test_stack()





"""simple docstring"""

from __future__ import annotations
def 		UpperCAmelCase					(		a_			):





		'''simple docstring'''


		for r in range(1,						a_			):
				lowerCamelCase     :			Tuple		=    []
				for x in range(n - 1			):
						lowerCamelCase     :			List[str]		=    pow(a_,						a_,						a_			)
						if val in li:
								break
						li.append(a_			)
				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)






