
"""simple docstring"""

from __future__ import annotations

import sys
def 		UpperCAmelCase					(		a_,						a_			):





		'''simple docstring'''


		if abs(a_			) == 1:
				return a, 0
		elif abs(a_			) == 1:
				return 0, b

		lowerCamelCase	,    lowerCamelCase     :			Union[str, Any]		=    a, b
		lowerCamelCase	,    lowerCamelCase     :			Optional[Any]		=    1, 0
		lowerCamelCase	,    lowerCamelCase     :			str		=    0, 1

		while remainder != 0:
				lowerCamelCase     :			str		=    old_remainder // remainder
				lowerCamelCase	,    lowerCamelCase     :			Any		=    remainder, old_remainder - quotient * remainder
				lowerCamelCase	,    lowerCamelCase     :			str		=    coeff_a, old_coeff_a - quotient * coeff_a
				lowerCamelCase	,    lowerCamelCase     :			Optional[int]		=    coeff_b, old_coeff_b - quotient * coeff_b

		# sign correction for negative numbers
		if a < 0:
				lowerCamelCase     :			List[Any]		=    -old_coeff_a
		if b < 0:
				lowerCamelCase     :			Tuple		=    -old_coeff_b

		return old_coeff_a, old_coeff_b
def 		UpperCAmelCase					(		):





		'''simple docstring'''


		if len(sys.argv			) < 3:
				print('2 integer arguments required'			)
				return 1
		lowerCamelCase     :			Union[str, Any]		=    int(sys.argv[1]			)
		lowerCamelCase     :			Dict		=    int(sys.argv[2]			)
		print(extended_euclidean_algorithm(a_,						a_			)			)
		return 0


if __name__ == "__main__":
					raise SystemExit(main())








"""simple docstring"""

from __future__ import annotations
def 		UpperCAmelCase					(		a_			):





		'''simple docstring'''


		assert (
		    isinstance(a_,						a_			) and mask > 0
		), F"""mask needs to be positive integer, your input {mask}"""
		lowerCamelCase     :			Tuple		=    []
		lowerCamelCase     :			Tuple		=    mask

		while submask:
				all_submasks.append(a_			)
				lowerCamelCase     :			Optional[int]		=    (submask - 1) & mask

		return all_submasks


if __name__ == "__main__":
					import doctest

					doctest.testmod()






