


'''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)







def      UpperCAmelCase						( lowerCAmelCase__					,     lowerCAmelCase__	):


		'''simple docstring'''

		if n < 0:
				return 0
		# table[i] represents the number of ways to get to amount i
		__A    =							[0] * (n + 1)

		# There is exactly 1 way to get to zero(You pick no coins).
		__A    =							1

		# Pick all coins one by one and update table[] values
		# after the index greater than or equal to the value of the
		# picked coin
		for coin_val in s:
				for j in range(lowerCAmelCase__					,     n + 1	):
						table[j] += table[j - coin_val]

		return table[n]


if __name__ == "__main__":
					import doctest

					doctest.testmod()

