






from __future__ import annotations

import sys





def 						A_					(						lowercase_	,  lowercase_			)				->tuple[int, int]:







 """simple docstring"""

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

 SCREAMING_SNAKE_CASE    ,   SCREAMING_SNAKE_CASE				    =		a, b
 SCREAMING_SNAKE_CASE    ,   SCREAMING_SNAKE_CASE				    =		1, 0
 SCREAMING_SNAKE_CASE    ,   SCREAMING_SNAKE_CASE				    =		0, 1

 while remainder != 0:
  SCREAMING_SNAKE_CASE				    =		old_remainder // remainder
  SCREAMING_SNAKE_CASE    ,   SCREAMING_SNAKE_CASE				    =		remainder, old_remainder - quotient * remainder
  SCREAMING_SNAKE_CASE    ,   SCREAMING_SNAKE_CASE				    =		coeff_a, old_coeff_a - quotient * coeff_a
  SCREAMING_SNAKE_CASE    ,   SCREAMING_SNAKE_CASE				    =		coeff_b, old_coeff_b - quotient * coeff_b

 # sign correction for negative numbers
 if a < 0:
  SCREAMING_SNAKE_CASE				    =		-old_coeff_a
 if b < 0:
  SCREAMING_SNAKE_CASE				    =		-old_coeff_b

 return old_coeff_a, old_coeff_b





def 						A_					(						)				->Optional[Any]:







 """simple docstring"""

 if len(sys.argv			) < 3:
  print('2 integer arguments required'			)
  return 1
 SCREAMING_SNAKE_CASE				    =		int(sys.argv[1]			)
 SCREAMING_SNAKE_CASE				    =		int(sys.argv[2]			)
 print(extended_euclidean_algorithm(lowercase_	,  lowercase_			)			)
 return 0


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












def 						A_					(						lowercase_	,  lowercase_			)				->List[Any]:







 """simple docstring"""

 SCREAMING_SNAKE_CASE				    =		1
 while b > 0:
  if b & 1:
   res *= a

  a *= a
  b >>= 1

 return res





def 						A_					(						lowercase_	,  lowercase_	,  lowercase_			)				->Any:







 """simple docstring"""

 SCREAMING_SNAKE_CASE				    =		1
 while b > 0:
  if b & 1:
   SCREAMING_SNAKE_CASE				    =		((res % c) * (a % c)) % c

  a *= a
  b >>= 1

 return res




