




from __future__ import annotations



def 	UpperCAmelCase_    (	__UpperCamelCase	):
    for r in range(1,				__UpperCamelCase	):
        SCREAMING_SNAKE_CASE__								=[]
        for x in range(n - 1	):
            SCREAMING_SNAKE_CASE__								=pow(__UpperCamelCase,				__UpperCamelCase,				__UpperCamelCase	)
            if val in li:
                break
            li.append(__UpperCamelCase	)
        else:
            return r
    return None


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

        lowerCamelCase_  						=   pow(b_public, a_private, q)
        lowerCamelCase_  						=   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_    (	__UpperCamelCase	):
    if not isinstance(__UpperCamelCase,				__UpperCamelCase	):
        raise ValueError("""double_factorial() only accepts integral values"""	)
    if n < 0:
        raise ValueError("""double_factorial() not defined for negative values"""	)
    return 1 if n <= 1 else n * double_factorial(n - 2	)


if __name__ == "__main__":
    import doctest

    doctest.testmod()






