





def 					lowerCAmelCase__(		lowercase				:			int      ,   lowercase				:			int )       ->			List[str]:




  while a != 0:
    __snake_case      : Optional[Any]						=				b % a, a
  return b







def 					lowerCAmelCase__(		lowercase				:			int      ,   lowercase				:			int )       ->			Union[str, Any]:




  if gcd(_A      ,   _A ) != 1:
    __snake_case      : List[str]						=				f"""mod inverse of {a!r} and {m!r} does not exist"""
    raise ValueError(_A )
  __snake_case      : Tuple						=				1, 0, a
  __snake_case      : Optional[int]						=				0, 1, m
  while va != 0:
    __snake_case      : Tuple						=				ua // va
    __snake_case      : str						=				(ua - q * va), (ua - q * va), (ua - q * va), va, va, va
  return ua % m





def       lowercase_		(		_A			:    int    ,					_A			:    int						):

      """simple docstring"""




      while a != 0:
            lowerCamelCase__    ,   lowerCamelCase__		:				Optional[Any]    =  b % a, a
      return b


def       lowercase_		(		_A			:    int    ,					_A			:    int						):

      """simple docstring"""




      if gcd(_A    ,					_A						) != 1:
            lowerCamelCase__		:				List[str]    =  F"mod inverse of {a!r} and {m!r} does not exist"
            raise ValueError(_A						)
      lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__		:				Tuple    =  1, 0, a
      lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__		:				Optional[int]    =  0, 1, m
      while va != 0:
            lowerCamelCase__		:				Tuple    =  ua // va
            lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__		:				str    =  (ua - q * va), (ua - q * va), (ua - q * va), va, va, va
      return ua % m


