from doctest import testmod
from math import sqrt
def    __magic_name__(	__UpperCAmelCase		)    ->     Dict:



      '''simple docstring'''

      _lowerCamelCase           =					[]
      if num < 1:
            return facs
      facs.append(1		)
      if num == 1:
            return facs
      facs.append(__UpperCAmelCase		)
      for i in range(2			,    int(sqrt(__UpperCAmelCase		)		) + 1		):
            if num % i == 0:  # If i is a factor of num
                  facs.append(__UpperCAmelCase		)
                  _lowerCamelCase           =					num // i  # num//i is the other factor of num
                  if d != i:  # If d and i are distinct
                        facs.append(__UpperCAmelCase		)  # we have found another factor
      facs.sort()
      return facs


if __name__ == "__main__":
     testmod(name='factors_of_a_number', verbose=True)




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)





