



'''simple docstring'''




from __future__ import annotations

import math
from itertools import permutations



def  __lowerCamelCase    (   _lowercase						) ->     bool:

							if 1 < number < 4:
														# 2 and 3 are primes
														return True
							elif number < 2 or number % 2 == 0 or number % 3 == 0:
														# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
														return False

							# All primes number are in format of 6k +/- 1
							for i in range(5      ,							int(math.sqrt(_lowercase						) + 1						)      ,							6						):
														if number % i == 0 or number % (i + 2) == 0:
																					return False
							return True



def  __lowerCamelCase    (   _lowercase = 7						) ->     int:
							UpperCAmelCase	:						Dict					=						"""""".join(str(_lowercase						) for i in range(1      ,							n + 1						)						)
							UpperCAmelCase	:						int					=						[int("""""".join(_lowercase						)						) for i in permutations(_lowercase      ,							_lowercase						)]
							UpperCAmelCase	:						int					=						[num for num in perm_list if is_prime(_lowercase						)]
							return max(_lowercase						) if pandigitals else 0


if __name__ == "__main__":
							print(F'''{solution() = }''')






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

