



from collections import namedtuple

__UpperCAmelCase    	=  namedtuple('''from_to''', '''from_ to''')

__UpperCAmelCase    	=  {
    '''millimeter''': '''mm''',
    '''centimeter''': '''cm''',
    '''meter''': '''m''',
    '''kilometer''': '''km''',
    '''inch''': '''in''',
    '''inche''': '''in''',  # Trailing 's' has been stripped off
    '''feet''': '''ft''',
    '''foot''': '''ft''',
    '''yard''': '''yd''',
    '''mile''': '''mi''',
}

__UpperCAmelCase    	=  {
    '''mm''': from_to(0.001, 10_00),
    '''cm''': from_to(0.01, 1_00),
    '''m''': from_to(1, 1),
    '''km''': from_to(10_00, 0.001),
    '''in''': from_to(0.0254, 39.3701),
    '''ft''': from_to(0.3048, 3.2_8084),
    '''yd''': from_to(0.9144, 1.0_9361),
    '''mi''': from_to(1609.34, 0.0_0062_1371),
}





def     __lowerCamelCase							(   __magic_name__						:	float  ,			__magic_name__						:	str  ,			__magic_name__						:	str    ):
							a__:							Optional[Any]									=from_type.lower().rstrip("s"    )
							a__:							Dict									=TYPE_CONVERSION.get(__magic_name__  ,			__magic_name__    )
							a__:							Dict									=to_type.lower().rstrip("s"    )
							a__:							List[Any]									=TYPE_CONVERSION.get(__magic_name__  ,			__magic_name__    )
							if new_from not in METRIC_CONVERSION:
														a__:							List[str]									=(
														    F"Invalid 'from_type' value: {from_type!r}.\n"
														    F"Conversion abbreviations are: {', '.join(__magic_name__    )}"
														)
														raise ValueError(__magic_name__    )
							if new_to not in METRIC_CONVERSION:
														a__:							int									=(
														    F"Invalid 'to_type' value: {to_type!r}.\n"
														    F"Conversion abbreviations are: {', '.join(__magic_name__    )}"
														)
														raise ValueError(__magic_name__    )
							return value * METRIC_CONVERSION[new_from].from_ * METRIC_CONVERSION[new_to].to


if __name__ == "__main__":
		import doctest

		doctest.testmod()










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)





